LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Command Problems (https://www.linuxquestions.org/questions/linux-general-1/command-problems-440031/)

somewhiteguy05 04-29-2006 11:58 AM

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?

Centinul 04-29-2006 12:07 PM

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.

wraithe 04-29-2006 12:11 PM

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..

whk 04-29-2006 12:32 PM

command line
 
use
# locate lspci

and choose the right path (copy and paste) is the easiest way.

alexander_bosakov 04-29-2006 04:19 PM

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)

somewhiteguy05 05-02-2006 04:54 AM

thanks for the help guys, they were in the /sbin directory

somewhiteguy05 05-02-2006 07:52 AM

how would i add those to my path though? i'm getting tired of having to type in the path and command

pixellany 05-02-2006 08:57 AM

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

somewhiteguy05 05-05-2006 01:32 PM

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

aress 05-11-2006 11:31 AM

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"


All times are GMT -5. The time now is 06:38 PM.