Become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Change to the directory that you want to clean out.
# cd directory |
Ensure that you are in the correct 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 that contain unnecessary, temporary or obsolete subdirectories and files. Delete these subdirectories and files by repeating Step 3.
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 # |