Home directory cleanup

When users' home directory filesystem(s) become full, the following steps may be used to reduce disk space usage.

1. Delete "core" files

Although it is possible that developers may use these files for debugging purposes, these files will likely have been renamed from "core" and should have been moved to a project-specific server. Deleting core files frees up several megabytes of disk space so that users will be able to write to the filesystem as further cleanup occurs.

find . -type f -name core | xargs rm

2. Find the largest disk space users

Execute the following command from within the home directory filesystem to generate a list of disk usage by size.

du -k * | sort -n

Users exceeding the threshold should be notified.

3. Find largest "tar" files

.tar files are by definition uncompressed archives, and are candidates for compression when they have not been recently accessed. For each large .tar file returned in the following find command, use "ls -l" and "ls -lu" to look at the file's change time (ctime) and access time (atime), respectively, to see if the file has had its data altered or accessed ecently.

find . -name \*.tar -ls | awk '{print $7, $11}' | sort -n

Repeat the process with other file extensions where appropriate, such as .log, .out, etc.

Back to brandonhutchinson.com.

Last modified: 09/19/2002