SEARCH

The How-To Geek Forums Have Migrated to Discourse

How-To Geek Forums / Geek Stuff

Linux - Script For Cleaning Up Autosave And Backup Files Left Behind By Programs

(2 posts)
  • Started 7 years ago by Zig
  • Latest reply from Michael
  • Topic Viewed 2155 times

Zig
Zig
Posts: 140

Here is a simple two-liner which recursively descends a directory hierarchy removing emacs auto-save (#) and backup (~) files, .o files, and TeX .log files. It also compresses .tex files and README files.

#!/bin/sh
#SQUEEZE removes unnecessary files and compresses .tex and README files
#By Barry tolnas, tolnas@sun1.engr.utk.edu
#
echo squeezing $PWD
find $PWD \( -name \*~ -or -name \*.o -or -name \*.log -or -name \*\#\) -exec
rm -f {} \;
find $PWD \( -name \*.tex -or -name \*README\* -or -name \*readme\* \) -exec gzip -9 {} \;

Posted 7 years ago
Top
 
michael
michael
Posts: 568

Yay! This is really useful for people who are paranoid about space.

Posted 6 years ago
Top
 



Topic Closed

This topic has been closed to new replies.