What is the purpose of the PATH variable?

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
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?
c. If your PATH variable is not set to search the working directory, how can
you execute a program located there?
d. Which command can you use to add the directory /usr/games to the end
of the list of directories in PATH?


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. 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. The /usr/bin/doit file will be executed because /usr/bin appears before
~/bin in PATH.
c. You can execute the command by giving either an absolute pathname or
a relative pathname such as ./program-name.
d. $ PATH=$PATH:/usr/games

Computer Science & Information Technology

You might also like to view...

A table is a collection of rows having one or more columns

Indicate whether the statement is true or false

Computer Science & Information Technology

On a report, the ________ calculates the total for all records

Fill in the blank(s) with correct word

Computer Science & Information Technology

One of the key components while creating a mobile website design is to have the most important information up-front and easily accessible.?

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Given the following two sets of numbers, what is the difference of the second set of numbers minus the first set? 1, 6, 98, 125, 126, 127, 250 1, 9, 98, 127, 250, 255, 260, 261

a. 6, 125, 126 b. 9, 255, 260, 261 c. 1, 98, 127, 250 d. 1, 6, 9, 98, 125, 126, 127, 250, 255, 260, 261

Computer Science & Information Technology