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 8 years ago by Zig
  • Latest reply from Michael
  • Topic Viewed 2155 times

PARTNER SPOTLIGHT

Recommended: Clean Your Mac the Easy Way with CleanMyMac 3

If you want to clean up your Mac the easy way, CleanMyMac is a great tool to get the job done easily, and it will even keep your computer clean automatically.

Unlike the competition, it also includes great tools like a Clean Uninstaller, to get rid of applications and clean up the junk that they leave behind. All with the click of a button.

Download CleanMyMac 3 for Free Today

Posted yesterday 
Top
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 8 years ago
Top
 
michael
Posts: 568

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

Posted 8 years ago
Top
 



Topic Closed

This topic has been closed to new replies.