Linux/Unix: File Size Determiner

This is a handy method to find files to reduce the size of a file system in either linux or solaris.

  1. Log onto the system in question and go to the file directory in question.
  2. run ‘du -sk’
  3. If a mail directory like someone’s home directory: find the Trash and copy /dev/null to empty the folder. sudo find . -name Trash -exec cp /dev/null {} “;”
  4. Find core files. Core files are left over from programs that terminate prematurely. If your organization analyzes the files then move them to another location, other wise remove the files.
  5. If your Linux/Solaris environment is heterogeneous with Windows, you should find and remove: Thumbs.db, thumbs.db and desktop.ini.
  6. Next find the largest files: sudo find . -size +10204 -exec ls -ald {} “;” and have the owner move or delete the files.
  7. Find old directories and gzip them. Gzip has a better compression ratio than zip. Note: if the file system is already reaching maximum capacity this will not work because gzip does not remove the files.
  8. Always use the find command and perform a listing of what you are looking for in the directory. You do not want to remove a file that is needed by a developer or the system itself.

Does anyone have any more suggestions for reducing the size of a directory other than growing the file system?
Mike Kniaziewicz

Comments are closed.