pavement

Path

From FreeBSDwiki
Revision as of 14:39, 5 December 2004 by Dave (Talk | contribs)
Jump to: navigation, search

Just as in MS-DOS, your path will be the directories that the OS will search for commands. Commonly, your path will include: /sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bin /home/[your username here]/bin

WARNING Don't ever, ever, ever, for any reason, put . in your path. Placing whatever your current directory is in your path may be convenient, but it's a delightfully easy way to run the wrong file -- many unix exploits rely on getting a user (or root) to run a trojaned file with the same name as a commonly run file.

NOTE Unlike in MS-DOS or Windows, the contents of your path are read once when you open your shell, not dynamically read every time you try to run a program without specifying the full path to it. So if you add a new program to one of the directories in your path, you'll have to reinitialize your path before you can run it without having to type its full path in. This can be done without logging out and back in again by issuing a rehash command.

To see your current path type in:

samizdata# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/opt
Personal tools