LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't find lsmod (https://www.linuxquestions.org/questions/linux-newbie-8/cant-find-lsmod-456136/)

da_marius 06-19-2006 02:46 AM

Can't find lsmod
 
I am using fedora core 5.
I can't use commands like iptables, lsmod and some other common commands.
Probably I didn't install a certain package but I don't know which.

acid_kewpie 06-19-2006 02:53 AM

they'll be there already, probably a path problem, which again is often caused by incorrect use of the su command. when you are logged in as a normal user, run "su -" to fully invoke the root users environment. alternatively, all these commands should live in /sbin/ so try /sbin/lsmod explicitly.

da_marius 06-19-2006 07:13 AM

thanks.it works now. but what can I do to use just the lsmod form and not /sbin/lsmod ?
except aliases.

acid_kewpie 06-19-2006 07:36 AM

as above, use "su -"

pixellany 06-19-2006 07:46 AM

Quote:

Originally Posted by da_marius
thanks.it works now. but what can I do to use just the lsmod form and not /sbin/lsmod ?
except aliases.

You need to put /sbin in your PATH variable:

export PATH="$PATH:/sbin"

to make this permanent, you need to put it in one of your startup configuration files---eg /etc/profile

ethics 06-19-2006 08:55 AM

whilst the above is very possible, there is a reason these files are in /sbin/ it's because they are supposed to be accessed by superusers, not mere mortals.

By adding it to your path it may make you slightly complacent with using it (although you still have to use sudo or su), and things like iptables etc. can be a bitch if you give some silly rules by accident.

Logging in via su - is a good reminder that you should be careful with it.

Adding to /etc/profile will also append it to EVERy users path upon login, which you may not want.

It may seem paranoid but these mechanisms are in place for good reasons

pixellany 06-19-2006 01:22 PM

Quote:

Originally Posted by ethics
whilst the above is very possible, there is a reason these files are in /sbin/ it's because they are supposed to be accessed by superusers, not mere mortals.

By adding it to your path it may make you slightly complacent with using it (although you still have to use sudo or su), and things like iptables etc. can be a bitch if you give some silly rules by accident.

Logging in via su - is a good reminder that you should be careful with it.

Adding to /etc/profile will also append it to EVERy users path upon login, which you may not want.

It may seem paranoid but these mechanisms are in place for good reasons

Good points...
I think I was assuming a root login, SU, or something.

I do find quite a few commands that I would like to access without using SU,SUDO, etc.

Another way would be to link certain /sbin commands into /bin

da_marius 06-19-2006 01:50 PM

the problem was that I couldn't acces them without path even in su mode.
now, after I've included the path it works.
thanks guys.

acid_kewpie 06-19-2006 03:46 PM

Quote:

Originally Posted by pixellany
Another way would be to link certain /sbin commands into /bin

yuck, i think i preferred the $PATH business...


All times are GMT -5. The time now is 02:17 PM.