File Management  «Prev  Next»

Removing Directories quickly in Unix - Exercise

Listing, copying, and removing directories

Objective:Use ls, cp, and rm to manage files and directories.

Exercise scoring

You will receive 2 points for this exercise.

Submitting your exercise

This exercise is auto-scored. When you have finished, just click the Submit button to receive full credit.


In this exercise, ls, cp, and rm will be used to practice the concepts you learned in the previous three lessons.


  1. Log in to your course account.
  2. Type the script command to begin saving your UNIX session to a file named ex200-1: % script ex200-1
  3. In your home directory, list your files, including hidden files.
  4. Display a recursive listing of the images directory tree.
  5. Copy the images directory to the project directory.
  6. Change to the project directory using the cd command.
  7. List the project directory. Then list the images subdirectory recursively.
  8. Remove the images directory you just copied by using the rm command instead of rmdir.
  9. Type exit to end the script command.
  10. Log out when you are done.


If you enter the logout command, but it responds "Not login shell," it means you forgot to end the script command.
Type exit and then logout.