
1. Find files that have not been accessed for a specified number of days and list them in a file. The following example locates regular files in /var/adm and its directories that have not been accessed in the last 100 days and saves the list of inactive files in /var/tmp/deadfiles.
# find /var/adm -type f -atime +100 -print > /var/tmp/deadfiles &
# more /var/tmp/deadfiles
/var/adm/aculog
/var/adm/spellhist
/var/adm/vold.log
/var/adm/messages.02. Review the generated list before removing any files. Check retention requirements, backups and application dependencies. Do not automatically delete files based only on access time; access-time tracking may be disabled or delayed.
Additional note:
# find directory -type f[-atime + nnn] [-mtime + nnn] -print > filenamedirectory – Directory to check.
-atime +nnn – Finds files that have not been accessed within the number of days.
-mtime +nnn – Finds files that have not been modified within the number of days.
+nnn – Number of days.
filename – File containing the list of inactive files.
