Oct
05
2009
Handy Linux Commands
By SD
Recursively Remove All Files With a Specific Extension:
Suppose you want to delete, recursively, all files with a specific file extension (e.g. a Java folder containing .class files). Run the following command:
$ find folderToStart/ -name \*.extension -exec rm {} \;
Bulk Renaming All Files Within a Folder
To replace a string within all files within a folder, just run the following:
$ for i in *; do newname=`echo $i|sed 's/search_txt/replace_txt/g'`; echo $newname; mv $i $newname; done
For more handy applications to bulk renaming using regular expressions, see this.
Check Folder Sizes on System
Very handy tutorial on how to do all aspects of disk space usage, can be found here.
