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. Thanks. Tony. |
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. |
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. |
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., Code:
alias fdisk='/sbin/fdsk' Code:
export PATH=${PATH}:/sbin |
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: Code:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games" Code:
PATH="${PATH}:/usr/sbin" |
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.
|
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: Code:
[peter ~]$ echo $PATH |
All times are GMT -5. The time now is 03:08 PM. |