LinuxQuestions.org
Help answer threads with 0 replies.
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-03-2007, 11:10 PM   #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-03-2007, 11:23 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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, 12: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, 01:02 AM   #4
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,448
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
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, 01: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, 02:01 AM   #6
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,448
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
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 02:02 AM.
 
Old 06-04-2007, 02:02 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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, 12: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



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 09:16 AM
When su to root, cannot use commands from sbin CornMaster Fedora 6 08-30-2005 01:37 PM
/sbin/rc: line 271: /sbin/devfsd: No such file or directory Alexander.s Linux - General 3 04-22-2005 04: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 09:29 AM
/sbin/clock and /sbin/hwclock: out of memory problems victor2000 Linux - General 0 07-29-2003 03:16 PM

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

All times are GMT -5. The time now is 09:37 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
Open Source Consulting | Domain Registration