LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-29-2006, 11:58 AM   #1
somewhiteguy05
LQ Newbie
 
Registered: Nov 2005
Location: SA, Tx, USA
Distribution: Mandrivia 2006, Fedora Core 5, Knoppix
Posts: 29

Rep: Reputation: 15
Command Problems


ok when i try to type in lspci or lsmod it says command not found, but when i do a man lspci or man lsmod it shows me all the options for it, what gives?
 
Old 04-29-2006, 12:07 PM   #2
Centinul
Member
 
Registered: Jun 2005
Distribution: Gentoo
Posts: 552

Rep: Reputation: 30
I would think probably means the locations of those binaries are not in your PATH variable. Try using the full path and see if the commands work for you. If they do then I would add them to your path. Also, were you trying these commands as root? Just curious. Hope this helps.
 
Old 04-29-2006, 12:11 PM   #3
wraithe
Member
 
Registered: Feb 2006
Location: Australia
Distribution: Linux... :-)
Posts: 241
Blog Entries: 1

Rep: Reputation: 50
Quote:
Originally Posted by somewhiteguy05
ok when i try to type in lspci or lsmod it says command not found, but when i do a man lspci or man lsmod it shows me all the options for it, what gives?
your man files are manuals not help...
the man pages are a totally seperate app...
unlike --help
the manpages contain most of the linux documentation...
wether its installed or not..
 
Old 04-29-2006, 12:32 PM   #4
whk
Member
 
Registered: Jun 2005
Posts: 202

Rep: Reputation: 37
command line

use
# locate lspci

and choose the right path (copy and paste) is the easiest way.
 
Old 04-29-2006, 04:19 PM   #5
alexander_bosakov
Member
 
Registered: Mar 2006
Location: Plovdiv, Bulgaria
Distribution: OpenSuse 11.3
Posts: 55

Rep: Reputation: 15
Usually /sbin and /usr/sbin directories are not included in the $PATH of the regular users. Try /sbin/lsmod, or add /sbin and /usr/sbin to your $PATH (in your ~/.bash_profile)
 
Old 05-02-2006, 04:54 AM   #6
somewhiteguy05
LQ Newbie
 
Registered: Nov 2005
Location: SA, Tx, USA
Distribution: Mandrivia 2006, Fedora Core 5, Knoppix
Posts: 29

Original Poster
Rep: Reputation: 15
thanks for the help guys, they were in the /sbin directory
 
Old 05-02-2006, 07:52 AM   #7
somewhiteguy05
LQ Newbie
 
Registered: Nov 2005
Location: SA, Tx, USA
Distribution: Mandrivia 2006, Fedora Core 5, Knoppix
Posts: 29

Original Poster
Rep: Reputation: 15
how would i add those to my path though? i'm getting tired of having to type in the path and command
 
Old 05-02-2006, 08:57 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
To add /sbin to your $PATH:

export PATH = "$PATH:/sbin"

To make this permanent, you have to put it in a configuration file that runs at startup---eg /etc/profile or ~/.bashrc
 
Old 05-05-2006, 01:32 PM   #9
somewhiteguy05
LQ Newbie
 
Registered: Nov 2005
Location: SA, Tx, USA
Distribution: Mandrivia 2006, Fedora Core 5, Knoppix
Posts: 29

Original Poster
Rep: Reputation: 15
Where should i add that in?

# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc

pathmunge () {
if ! echo $PATH | /bin/egrep -q "(^|$1($|" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}

# ksh workaround
if [ -z "$EUID" -a -x /usr/bin/id ]; then
EUID=`id -u`
UID=`id -ru`
fi

# Path manipulation
if [ "$EUID" = "0" ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi

# No core files by default
ulimit -S -c 0 > /dev/null 2>&1

if [ -x /usr/bin/id ]; then
USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
fi

HOSTNAME=`/bin/hostname`
HISTSIZE=1000

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
done

unset i
unset pathmunge
 
Old 05-11-2006, 11:31 AM   #10
aress
LQ Newbie
 
Registered: Mar 2006
Posts: 11

Rep: Reputation: 0
Hi,

Try to enter right below the line

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

It should look as

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
export PATH = "$PATH:/sbin"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problems with the wish command Snerkel Linux - Software 3 08-19-2004 02:06 PM
Problems with the cp command... Killah Linux - Newbie 2 04-05-2004 05:13 PM
Problems with startx command jmillet Linux - Software 4 03-19-2004 02:30 AM
Root Command Problems BittaBrotha Debian 11 07-31-2003 10:21 PM
Problems with command in Chapt 5 ?? Grim Reaper Linux From Scratch 6 11-19-2002 06:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration