Book Read Free

Learning Old School Linux

Page 4

by Ed Hartnett


  ~/Mail $

  For more information about the du command, try man du, but there's not much to this tool.

  Using find to Catch the Big Fish

  When cleaning up a disk, the find utility can also come in very handy. The find command has so many different arguments that reading the man page can be a bit scary! There are an astonishing number of ways to specify which files you want to find, and what you want to do with them once you find them.

  Back in the old days, we used to use find to automatically delete large files after a few days of inactivity on the physics department computers. Today, that sounds like pretty rough treatment, but back then, disks were expensive and life was cheap.

  For a simple use of find, just use the --size parameter. Then use something like +3M to tell it you want to find files larger than 3MB. (You can also use "G" for gigabyes, or "k" for kilobytes.)

  ~ $ find --size +3M

  ./.mozilla/firefox/6wi42rce.default/urlclassifier2.sqlite

  ./My Documents/My Videos/eeepc.wmv

  ./My Documents/My Music/amarok-tmp-0.170-1204660416186385&lid=751-usa&from=pls.part

  ./My Documents/My Music/Day & Night.wma

  ./My Documents/My Ebooks/manual.CHM

 

‹ Prev