Here’s some linux tricks I use in my line of work. I find them useful, you may not. You decide.
Delete all files and folders recursively, including hidden ones
The example below will remove all folders called .svn within the current directory
find . -name ".svn" -type d -exec rm -rf {} \;
Rename file extensions within a folder
The example will rename files with a .jpg extension to .png within the current directory
for f in *.jpg; do mv ./"$f" "${f%jpg}png"; done
Disk space usage per directory
Returns human-readable (ie. mb, kb, gb instead of a long number) total bytes for the current directory
du -ch | grep total
Download all files of a certain type from a website
The example will download all .flv files from [URL]
wget [URL] -r -l2 -A.flv -H -nd
I’ll update this with anything new I think is useful. In 4 years I haven’t found anything further that’s useful to me so don’t check back with any vigour.
