PATH is an environmental variable in Linux and other Unix-like operating systems that tells the shell which directories to search for executable files (i.e., applications/programs) in response to commands issued by a user. For instance, when you run "ls", you are really running "/bin/ls" and your shell finds this executable since the folder "/bin" is part of your PATH.
*NOTE: Do not confuse PATH with path. PATH is an environment variable. You can list all environment variables by typing "env" at the command prompt. The non-capitalized "path" simply means the file path.
Briefly, we give you 3 scenarios on how you can run an executable:
Let's assume that you downloaded the nachos-153.tgz and extracted it to your home directory. To ensure you are in your home directory, type "cd" with no arguments. Your path should now be "~", which means "home".
1.) Full path
If an executable is *not* in your PATH you can run it by simply typing the full path to its location. Assuming the "nachos" folder is in your home directory, you could type ~/nachos/bin/nachos to run the nachos executable, no matter what your working directory is.
2.) Export PATH via command line (temporary)
To temporarily add a folder to your PATH, you can use "export". Typing "export PATH=$PATH:$HOME/nachos/bin" to add the nachos binaries folder to your path. Now you can run the "nachos" executable from any folder, without typing the full path. This will only last for as long as that current instance of your shell is running. The changes will only last until you log-out or close the shell (if its a window).
3.) Add to PATH via shell configuration file (e.g., .bashrc) (permanent)
One of the above files, located in your home directory, has an entry which specifies your PATH environment variable. Note that you must run "ls -a" to see hidden files (hidden files are those that are prefixed with a period). Find the line which specifies your PATH and add append ":$HOME/nachos/bin" to it. For example, if you currently the following:
edit it, such that you have thisPATH=/bin:/sbin:/usr/local/bin
Save the file. This change will be permanent, but will not be reflected until you run the "sourcePATH=/bin:/sbin:/usr/local/bin:$HOME/nachos/bin