Saturday, October 13, 2007

Edit Default Path

===Changing the default search path===
I always make a small change to my default $PATH because when I work with sudo I still can't use some of the system commands without typing the path to the command and then the command. A good number of the commands reside under /sbin, so I add /sbin to my $PATH. Here's what I do. Open a terminal as your regular user and edit the file .bash_profile in your home folder.
gedit .bash_profile
This is what the default file looks like.
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
I change the file to look like this, adding :/sbin to the end of the $PATH line.
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/sbin
export PATH
Save the file and exit the editor. Log out and back in to the desktop and you will now have access to the commands in /sbin by default.

Return to [[Fedora 7]]

No comments: