Linux Questions Help
Need some help answering the following questions. I appreciate any help.
. What is the purpose of the PATH variable? a. Set up your PATH variable so that it causes the shell to search the following directories in order: • /usr/local/bin • /usr/bin/Xl1 • /usr/bin • /bin • /usr/kerberos/bin • Your own bin directory (usually bin or .bin in your home directory) • The working directory b. If a file named doit is in /usr/bin and also in your ~/bin, which one doit will be executed? (Assume that you have execute permission for both of the files.) 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 /user/games to the end of the list of directories in your PATH? |
The PATH environment variable tells the shell where to look for a program when you type its name on the command line.
For example, to search for files, you'll often use the program "find". "find" is just a regular program like any other, and it generally lives in "/usr/bin/". So that you don't have to manually type out "/usr/bin/find" every time you want to run it, you can instead add "/usr/bin/" to your PATH. Once "/usr/bin/" is in your PATH, you can just type "find", and the shell will locate and run the program. The rest sounds like a homework problem, so I'll forego answering them for you. |
Purpose - see question 2.
A. yes B the first one in the PATH variable C. direct call with pathname e.g. ~/bin/dolt, or ./dolt if you're in ~/bin/ D. PATH=/usr/games:$PATH; |
Quote:
We will always be glad to HELP, but you have to show effort on your part. |
All times are GMT -5. The time now is 12:52 PM. |