Special File Types   «Prev  Next»

Search Paths | Commands - Exercise

Search paths and commands

Locating commands in Linux and Unix

Objective: Determine where a command is located and modify the search path to use the command.

This was a Java applet

This exercise uses a Java applet to simulate a UNIX command line and allows you to practice entering commands. If you do not have Java active in your browser or are behind a firewall that does not allow Java applets, you will not be able to complete this exercise. If you do not see the applet below, click Submit to view the exercise solution and continue with the course.

Exercise scoring

This exercise is not scored. When you have completed the exercise, click the Submit button to continue with the course.


You are the systems administrator for an organization with offices in Bombay, Seattle, and London. Currently, you are in Seattle. You have found that you must reboot one of your UNIX systems. You have learned that the shutdown -t1 -r command will reboot the system. This system is relatively new, and no one has used the shutdown command on it before.


In this exercise, you will see how well you understand determining where a command is located and modifying the search path. Although the simulation uses a Linux machine, the process is almost identical across all versions.
Start the simulation below and work through the situation presented.

  1. You are already logged on as root, so shut down the system by typing |||(S1)shutdown -t 1 -r now shutting down|||(S0).
  2. Shutdown system
  3. shutdown -t 1 -r now shutting down
  4. Note the error message. Now, use the |||(S7)whereis|||(S0) command to determine the location of the shutdown file.
  5. The whereis command
  6. whereis shutdown
  7. Type |||(S1)whereis shutdown|||(S0). This will tell you where the shutdown command is located.
  8. Note that the system returns two entries: The first informs you about the location of the actual shutdown file (/sbin/shutdown). The second informs you about the presence of a man file about shutdown. Now, change to the /sbin directory.