Bash

Useful bash scripts

Posted by Jeff Beeman on Wed, 11/21/2007 - 10:52

Just some personally useful bash scripts:

Find and delete files using a pattern

Find all files containing a particular string and do something with them - in this case, delete all files like "._*" i.e. "._user.module". This is usually junk left over from dead SSH sessions


for FILE in $(find . | grep '\._');
do
rm $FILE;
done;

Subscribe to Bash