[NBLUG/talk] What's with /sbin ?

ME dugan at passwall.com
Wed Sep 24 12:19:03 PDT 2003


Dave Sisley said:
> I have a 2 part question, the first of which is embarrassingly newbish:
> 1)
> How do I get /sbin added to my default path, so that I don't have to
> use absolute pathnames for such useful commands as 'ifup' and 'ifconfig'?

Several ways. For all users, if you use bash, edit /etc/profile and change
this:
PATH="/usr/bin:/bin:/usr/bin/X11:/usr/games"
to:
PATH="/sbin:/usr/sbin:/usr/bin:/bin:/usr/bin/X11:/usr/games"

(Such that whatever you had in the PATH before is prefixed with
"/sbin:/usr/sbin:"
)

Or on a per-user basis with bash, edit ~/.bash_profile and add this near
the end:

export PATH="/sbin:/usr/sbin:${PATH}"

Which will prepend  "/sbin:/usr/sbin" to your PATH for each session.

> 2)
> Is there something special about /sbin (in Redhat, anyway) that would
> necessatate "hiding" these commands?  If they are in there, why isn't
> /sbin included in the default PATH?

Generally, the "/sbin" and "/usr/sbin" file are used by superuser and
omitted from regular users' PATH.

Enjoy,
-ME




More information about the talk mailing list