Extending your search path

From Crashcourse Wiki

Jump to: navigation, search

This is a painfully trivial recipe, but it's surprising how many users aren't aware of it. Fairly often, even regular users might want to run what you would normally consider "administrative" commands such ifconfig, not to change any system configuration, but just to view it.

Unfortunately, by default, the two directories that most administrative commands live in, /sbin and /usr/sbin, aren't part of the standard user search path, which typically forces you to constantly fully qualify the filename:

$ ifconfig
bash: ifconfig: command not found
$ /sbin/ifconfig
... ifconfig output ...

The obvious solution is to just add those two directory names to your search path by editing your personal .bash_profile and, for example, adding a line like this at the bottom:

PATH=/sbin:/usr/sbin:$PATH

Once you do that, log out of your desktop and log back in again, and your new search path should be in effect.

Feedback to rpjday@crashcourse.ca.

Return to Fedora_Cookbook.

Personal tools