Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-22-2006, 10:49 AM   #1
LQ Newbie
Registered: Apr 2005
Distribution: Fedora Core 5
Posts: 17

Rep: Reputation: 0
Do I have to type /sbin/

Ive been using linux for a while now. Moved from opensuse 10 over to fedora core 5, just to try it out really. I quite like it, but one thing bugs me. I am constantly typing /sbin/ for commands. Now I know I dont have to, because I never used to in Suse, but how do I set up the console to work without me typing /sbin/
Im guessing its something to do with the alias command, but Im haveing some problems with the alias command. How do I get rid of lines? specifically rm=rm -i
I would experiment, but I dont want to untill I know I can get rid of any dodgy lines in the alias command.

Last edited by snay; 05-22-2006 at 10:53 AM.
Old 05-22-2006, 11:12 AM   #2
Registered: Mar 2005
Location: UK
Distribution: opensuse 12.2 x86_64
Posts: 563

Rep: Reputation: 38
Add alias lines to your .bashrc file in your home directory. Lines like

alias rip='cdparanoia "1-" -v'

work fine. If you want to remove them, just edit .bashrc and restart Konsole.
Old 05-22-2006, 11:18 AM   #3
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 272Reputation: 272Reputation: 272
I believe you alias commands should be in the file ~/.bashrc. Just comment out the line that says alias rm=`rm -i`

I believe you can add EXPORT PATH=/sbin: $PATH to the top of your .bashrc file and/or ~/.bash_profile. Then just do a source .bashrc and it should apply it to the current session. Otherwise, just logout and log back in, then type echo $PATH and see if it's been added.
Old 05-22-2006, 11:19 AM   #4
Senior Member
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,413
Blog Entries: 1

Rep: Reputation: 65
For commands you have to type /sbin in front, there is 2 ways to solve this:

create an alias for it in .bashrc, e.g.,
alias fdisk='/sbin/fdsk'
or append /sbin to your path. Do that in .profile:
export PATH=${PATH}:/sbin
To fix 'rm', search where this alias is set (.bashrc, .alias, .profile) or clear the alias with the command "unalias rm". "unalias -a" will clear all aliases defined.
Old 05-22-2006, 11:26 AM   #5
Registered: Nov 2005
Posts: 144

Rep: Reputation: 18
You should add sbin to your $PATH - variable. Whenever you type the name of some application in terminal, bash looks for an executable file with that name in the directories in the $PATH - variable.
The path variable consists of several colon-seperated directories. This is mine:
You can simply add /usr/sbin/ via:
However, that will only set the path variable for your current session. If you want to have it in your path variable whenever you login, you should put it into ~/.bash_profile. If you want it to be in the path variable of every user, you can modify /etc/profile and change the path variable there.
Old 05-22-2006, 11:27 AM   #6
Senior Member
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
There is a reason these files are in /sbin/ it's because they are generally supposed to be called by root (who should have sbin in his path by default). I use Sudo but still maintain typing the /sbin/ path so that i don't become complacent about when and as whom i am running these commands as.
Old 05-22-2006, 11:29 AM   #7
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 347Reputation: 347Reputation: 347Reputation: 347
By way of clarification, a "normal" user should not need to use any of the commands in /sbin since they are (mostly) related to system administration tasks. For example, the rm command is in /bin, not /sbin.

That said, where your system looks for commands is controlled by the values of $PATH. The settings I have are like this:
[peter ~]$ echo $PATH
[peter ~]$ su -
[root@tss-4 ~]# echo $PATH
You can change what's in $PATH by editing /etc/profile so it calls pathmunge for the directories you want to add.


alias, bashrc

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
/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
/usr/sbin and /sbin world read/executable... why? lazlow69 Slackware 3 04-29-2004 05:06 PM
As root, not seeing /sbin and /usr/sbin in path weghman Linux - Newbie 3 04-25-2004 01:06 PM
/sbin/clock and /sbin/hwclock: out of memory problems victor2000 Linux - General 0 07-29-2003 03:16 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:08 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration