Forum Moderators: bakedjake
Most text editors will automatically create a backup when you edit a file, and pretty soon your directory tree gets filled with files like index.html~ index.html.bak etc. This script crawls recursively through the directory tree deleting common backup filetypes, leaving it nice and clean for uploading. Save somewhere in your path as 'clean' and chmod it to 755
-------------
#!/usr/bin/perl
# usage: clean /home/html
# where /home/html is the root directory of the tree to clean
use File::Find;
$path=shift;
find sub {my $foo=$File::Find::name;
unlink $foo if ($foo=~/~$¦\.bak$¦\#$/);
},$path;
-------------
I'm sure there's a neater way to do this in straight shell - any takers?