How to Clear Out Temporary Directories
Change to the directory to clean out.
# cd directory
Caution - Be sure you are in the right directory before completing step 3. Step 3 deletes all files in the current directory.
Delete the files and subdirectories in the current directory.
# rm -r *
Change to other directories containing unnecessary temporary or obsolete subdirectories and files, and delete them by repeating Step 3.
Example--Clearing Out Temporary Directories
The following example shows how to clear out the mywork directory, and how to verify that all files and subdirectories were removed.
# cd mywork # ls filea.000 fileb.000 filec.001 # rm -r * # ls # |
How to Find and Delete core Files
Change to the directory where you want to search for core files.
Find and remove any core files in this directory and its subdirectories.
# find . -name core -exec rm {} \;
Example--Finding and Deleting core Files
The following example shows how to find and remove core files from the jones user account by using the find command.
# cd /home/jones# find . -name core -exec rm {} \; |
How to Delete Crash Dump Files
Crash dump files can be very large, so if you have enabled your system to store these files, do not retain them for longer than necessary.
Change to the directory where crash dump files are stored.
# cd /var/crash/system
Where system identifies a system that created the crash dump files.
Caution - Be sure you are in the right directory before completing step 3. Step 3 deletes all files in the current directory.
Remove the crash dump files.
# rm *
Verify that the crash dump files are removed.
# ls
Example--Deleting Crash Dump Files
The following example shows how to remove crash dump files from the system venus, and how to verify that the crash dump files were removed.
# cd /var/crash/venus # rm * # ls |