Spring cleaning your file space

PDF file Managing files in Unix

If you run out of file space it may be because you have acquired files - possibly large files - which can be deleted.

Finding unwanted files

Use the ls command to obtain a list of all your files, including those in subdirectories, and their sizes. If you have quite a lot of files, direct this list to a temporary file where you can inspect it at leisure: for example to put the list into a file in temporary storage called /tmp/my_files

ls -alR > /tmp/my_files

Search the file list for files called core and delete them (these are files created when an application fails).

Do not delete files unless you are certain of what they are. Take particular care not to delete your .login, .cshrc and .dtprofile files.

Check your mail

Look at the listing of the Mail directory in your home directory. This contains your e-mail folders. If any of these are large, you may save space by deleting old messages in them. Use a mailer such as Pine to do this, do not try to edit mail folders directly. Working on folders called saved-messages or sent-mail will be particularly useful, because they will contain messages you have long forgotten about.

If you have mail folders, the contents of which you know for certain you won't need again, you can remove them from the Mail directory directly from Unix, using the rm command.

Check your web browser cache

Web browsers keep a cache of recently visited pages in your file space. You should check the size that the cache is set to and clear or reduce it in size if necessary.