LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-19-2006, 02:46 AM   #1
da_marius
Member
 
Registered: Dec 2005
Location: Bucharest, Romania
Distribution: Ubuntu 10.04
Posts: 38

Rep: Reputation: 15
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.
 
Old 06-19-2006, 02:53 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 06-19-2006, 07:13 AM   #3
da_marius
Member
 
Registered: Dec 2005
Location: Bucharest, Romania
Distribution: Ubuntu 10.04
Posts: 38

Original Poster
Rep: Reputation: 15
thanks.it works now. but what can I do to use just the lsmod form and not /sbin/lsmod ?
except aliases.
 
Old 06-19-2006, 07:36 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
as above, use "su -"
 
Old 06-19-2006, 07:46 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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
 
Old 06-19-2006, 08:55 AM   #6
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
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
 
Old 06-19-2006, 01:22 PM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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
 
Old 06-19-2006, 01:50 PM   #8
da_marius
Member
 
Registered: Dec 2005
Location: Bucharest, Romania
Distribution: Ubuntu 10.04
Posts: 38

Original Poster
Rep: Reputation: 15
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.

Last edited by da_marius; 06-20-2006 at 09:20 AM.
 
Old 06-19-2006, 03:46 PM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally Posted by pixellany
Another way would be to link certain /sbin commands into /bin
yuck, i think i preferred the $PATH business...
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lsmod segfault? z-vet Yoper 6 12-15-2004 03:40 PM
lsmod and depmod hyperriven Linux - Software 2 10-17-2004 12:18 AM
Why can't I use lsmod rmmod etc JohnSharp Linux - Newbie 4 04-08-2004 10:11 AM
lsmod in redhat 8.0 luap Linux - Distributions 9 03-14-2003 07:15 PM
lsmod shoot2kill Linux - General 5 04-29-2002 09:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:43 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