LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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-04-2007, 12:10 AM   #1
jaredhocutt
LQ Newbie
 
Registered: May 2007
Location: Raleigh, NC
Distribution: Debian
Posts: 9

Rep: Reputation: 0
Question Commands in sbin


I am fairly new to Linux, but have had a bit of experience in Debian Linux. I am now trying out the new Fedora 7 and having a few problems. Normally when I want to run a command such as
Code:
modprobe
I can just run it by typing
Code:
modprobe
as root and it works. However, in Fedora 7, I am having to type
Code:
/sbin/modprobe
in order for it to work. This is also true for any common commands. I was wondering if there was a way that I can change this so that I can just type the command like normal.
 
Old 06-04-2007, 12:23 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
You need to be root for the command to work anyway. You could add /sbin/ to your path, but it may be better to leave it as it is and run the command like "sudo /sbin/modprobe ...".

Normal user commands aren't in /sbin. There are some user commands in /usr/bin. Make sure that that is in your path.
 
Old 06-04-2007, 01:57 AM   #3
jaredhocutt
LQ Newbie
 
Registered: May 2007
Location: Raleigh, NC
Distribution: Debian
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks. I found out that if I log in as root from the login screen everything works as it should, but if I log on as my username and then open terminal and login to root using su then it doesnt work, so I guess I'll just log in as root when I need to perform those commands.
 
Old 06-04-2007, 02:02 AM   #4
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 1,960

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
Quote:
Originally Posted by jaredhocutt
Thanks. I found out that if I log in as root from the login screen everything works as it should, but if I log on as my username and then open terminal and login to root using su then it doesnt work, so I guess I'll just log in as root when I need to perform those commands.
You can use
Code:
su -
to switch to root's environment.
 
Old 06-04-2007, 02:49 AM   #5
jaredhocutt
LQ Newbie
 
Registered: May 2007
Location: Raleigh, NC
Distribution: Debian
Posts: 9

Original Poster
Rep: Reputation: 0
that's how I was originally doing it by using
Code:
su
but I was having the same problem, but as long as I login as root from the login screen, then it works correctly. Not sure why, but I can live with it. Thanks anyways though!
 
Old 06-04-2007, 03:01 AM   #6
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 1,960

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
Quote:
Originally Posted by jaredhocutt
that's how I was originally doing it by using
Code:
su
Look again.
Code:
su -
That's su 'minus.' Don't forget the space.

Last edited by rkelsen; 06-04-2007 at 03:02 AM.
 
Old 06-04-2007, 03:02 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
No, they aren't the same. "su -" starts an interactive shell, so root's environmen, so root's ~/.profile script is run, setting up root's PATH variable. Simply using "su", you are running as root, but in your own environment.
 
Old 06-05-2007, 01:36 PM   #8
jaredhocutt
LQ Newbie
 
Registered: May 2007
Location: Raleigh, NC
Distribution: Debian
Posts: 9

Original Poster
Rep: Reputation: 0
Ohh ok! Thanks, that works so much better! Sorry, I'm new at this!
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Chkroot scan - /sbin/init & /sbin/ifconfig INFECTED bicoba Linux - Security 4 06-07-2006 10:16 AM
When su to root, cannot use commands from sbin CornMaster Fedora 6 08-30-2005 02:37 PM
/sbin/rc: line 271: /sbin/devfsd: No such file or directory Alexander.s Linux - General 3 04-22-2005 05:44 PM
Want2use /sbin cmds undr non-root account w/o sudo. Is it safe 2 add /sbin 2 my PATH? kornerr Linux - General 4 02-25-2005 10:29 AM
/sbin/clock and /sbin/hwclock: out of memory problems victor2000 Linux - General 0 07-29-2003 04:16 PM


All times are GMT -5. The time now is 04:23 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration