LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   lsmod and modprobe commands (https://www.linuxquestions.org/questions/linux-newbie-8/lsmod-and-modprobe-commands-177075/)

rock9604 05-02-2004 04:48 PM

lsmod and modprobe commands
 
I am trying to use lsmod and modprobe commands. They are giving me an error command not found. What do I do?

Komakino 05-02-2004 04:49 PM

Log in as root or type:
Code:

su -
(note the hyphen) from the console and then try again

bruno buys 05-02-2004 04:50 PM

These commands are available only to the root user.

rock9604 05-02-2004 04:54 PM

Root
 
Sorry I forgot to say i am login as Root. Thanks for the quick response.

bruno buys 05-02-2004 05:04 PM

Here in my suse, modprobe and lsmod are provided by a package named modutils. Ask rpm if modutils is installed:
rpm -q modutils
If not, install it and try again.

rock9604 05-02-2004 05:49 PM

Yes modutils is installed version 2.4.25-13 it says. I can launch the man pages and read everything about them. Should I be in a certion directory or what directory do they live in.

bruno buys 05-02-2004 06:02 PM

Try to locate the binaries:
whereis modprobe
whereis lsmod

It will answer sommething like

modprobe: /sbin/modprobe.old /sbin/modprobe /sbin/modprobe.static /etc/modprobe.conf /usr/share/man/man8/modprobe.8.gz

So, you can run the command by typing "/sbin/modprobe".

btmiller 05-02-2004 06:18 PM

On at least one of my systems modprobe and lsmod are in /sbin so you would type /sbin/modprobe and /sbin/lsmod. If you're ever curious about where commands are you can try typing whereis <command> or locate <command>.

Also, it's possible to run lsmod as a non-root user, but non-root users tend not to have /sbin or /usr/sbin in their path.

rock9604 05-02-2004 06:52 PM

Thank you. If I type the path then the commands work. Thanks again.

Boneglorious 05-02-2004 07:41 PM

So now you want to edit your .bash_profile so you don't have to type the path. Look in it, and see that some lines are of form:

PATH=$PATH:/la la la.

You want these lines to include all the paths for commands you use. My .bash_profile contains:

PATH=$PATH:/bin
PATH=$PATH:/sbin
PATH=$PATH:$HOME/bin
PATH=$PATH:$HOME/sbin

and that appears to be sufficient.


--boneglorious
the vainglorious newbie

rock9604 05-02-2004 11:35 PM

Thank you for the path's. It works great now.


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