The LinuxDig.Com Linux Dictionary is currently in Beta. You can help, email Comments or Suggestions here.
Number of Terms : 8142 Number of Definitions : 9135
$PATH1. The search path for commands. It is a colon-separated list of directories in which the shell looks for commands (see COMMAND EXECUTION below). The default path is system-dependent, and is set by the administrator who installs bash. A common value is ``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.''. From Rute-Users-Guide 2. The shell looks for commands and programs in a list of file paths stored in the PATH environment variable. An environment variable stores information in a place where other programs and commands can access it. Environment variables store information such as the shell that you are using, your login name, and your current working directory. To see a list of all the environment variables currently defined; type 'set' at the prompt. When you type a command at the shell prompt, the shell will look for that command's program file in each directory listed in the PATH variable, in order. The first program found matching the command you typed will be run. If the command's program file is not in a directory listed in you PATH environment variable, the shell returns a "commands not found" error. By default, the shell does not look in your current working directory or your home directory for commands This is really a security mechanism so that you don't execute programs by accident. What if a malicious user put a harmful program called ls in your home directory? If you typed ls and the shell looked for the fake program in your home directory before the real program in the /bin directory, what do you think woul dhappen? If you thought bad things, you are on the right track. Since your PATH doesn't have the current directory as one of its search locations, programs in your current directory must be called with an absolute path of a relative path specified as './program-name'. To see what directories are part of your PATH enter this command: # echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11 From Complete-Idiot's Guide to Linux |
|
|