The search path and the root account

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


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.


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