Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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.
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:
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.
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: