DAMTP Computing News

170) 19/08/93  Cleanup script for HPs and Suns [jp107]

A script which will tidy the contents of a directory and remove unwanted files is now available for HPs and Sun machines. The program called cleanup removes all old emacs ~ files, and any .dvi and .log files where the corresponding .tex file still exists. It also will gzip any 'core' or a.out files which have not been read for at least 2 days. As it runs the script will output the names and sizes of all files it deletes and gives the output of gzip of those files it compresses. Normally cleanup deletes the files quietly but if the -i flag is given then cleanup prompts before deleting anything (though not before compressing files since those can be simply undone.) If no directory is specified then the script will run on your entire home directory. E.g.

      $ cleanup -i .
      -rw-r--r--  1 jp107        2368 Aug 19 17:43 ./welcome.dvi
      rm: remove ./welcome.dvi? n
      -rw-r--r--  1 jp107         206 Aug 19 17:46 ./welcome.log
      rm: remove ./welcome.log? y

or

      $ cleanup
      -rwxr-xr-x  1 jp107         371 Mar  2  1992 /home/kronos/jp107/cmds/tidy~
      -rw-r--r--  1 jp107     8145728 Aug 15 12:33 /home/kronos/jp107/core
      /home/kronos/jp107/core: 99.6% -- replaced with /home/kronos/jp107/core.gz

Search in all news items