System Administration Guide

How to Clear Out Temporary Directories

  1. Become superuser.

  2. Change to the /var/tmp directory.


    # cd /var/tmp
    

    Caution - Caution -

    Be sure you are in the right directory before completing the following step. The next step deletes all files in the current directory.


  3. Delete the files and subdirectories in the current directory.


    # rm -r *
    
  4. Change to other directories containing temporary or obsolete subdirectories and files (for example, mail, lost+found, or quotas), and delete them by repeating Step 3 above.

Example--Clearing Out Temporary Directories

The following example shows how to clear out the /var/tmp directory, and verifies that all files and subdirectories were removed.


# cd /var/tmp
# ls
deadfiles           wxconAAAa0003r:0.0  wxconAAAa000NA:0.0
test_dir            wxconAAAa0003u:0.0  wxconAAAa000cc:0.0 
wxconAAAa000zs:0.0
# rm -r *
# ls
#