Given the root account's special privileges, it's not surprising that that account's search path typically contains extra directories corresponding to system administration commands, such as /sbin, /usr/sbin, and possibly others:
# echo $PATH /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:...
Tip | |
---|---|
While directories like /sbin and /usr/sbin contain, for the most part, administrative commands, there's nothing technically illegal about regular, non-root users adding these directories to their search paths. In many cases, there are commands in those directories that regular users can run, albeit in a restricted way. |
Warning | |
---|---|
Under no circumstances, if you are the administrator, should you add the current working directory . to root's search path. This is a recipe for disaster -- exactly why is left as an exercise for the reader. If, as root, you must run an executable in the current directory, use the explicit form: # ./programname |