What is the purpose of the PATH variable?
What will be an ideal response?
When you give the shell a simple filename as a command, the shell searches
through directories specified by the PATH variable for the program you
want to execute. It looks for a file that has the same name as the command
and that you have execute permission for (a compiled program) or read and
execute permission for (a shell script).
a. Set the PATH variable and place it in the environment so it causes the
shell to search the following directories in order:
• /usr/local/bin
• /usr/bin
• /bin
• /usr/kerberos/bin
• The bin directory in your home directory
• The working directory
The following command sets the PATH variable as specified and places
it in the environment:
$ export PATH=/usr/local/bin:/usr/bin:/bin:/usr/kerberos/bin:~/bin:.:
b. If there is an executable file named doit in /usr/bin and another file with
the same name in your ~/bin directory, which one will be executed?
The /usr/bin/doit file will be executed because /usr/bin appears before
~/bin in PATH.
c. If your PATH variable is not set to search the working directory, how can
you execute a program located there?
You can execute the command by giving either an absolute pathname or
a relative pathname such as ./program-name.
d. Which command can you use to add the directory /usr/games to the end
of the list of directories in PATH?
$ PATH=$PATH:/usr/games
You might also like to view...
When setting the Relationship Options for a relationship between two tables, selecting the checkbox beside ________ allows a user to update all instances of a common field in table two when the primary key in table one is updated. For example, if the primary key in table one changes from 100 to 101, all instance in table two that have 100 as the common field will now update to 101
Fill in the blank(s) with correct word
Which of the following Windows 7 features asks for permission before allowing changes to your system settings?
A) UAC B) Windows firewall C) Windows Updates D) Action Center