Tuesday, November 29, 2011

The watch command

Wow, what a useful command I just learned of.
Watch executes any task at a given interval, like a hassle-free on the fly cron job.
For instance to display your arp table and refresh every 10 seconds:

watch -n 10 arp -a

Thursday, November 3, 2011

Mass file renaming

I just learned that Linux's rename command can use regular expressions to  substitute file name parts.

(-v tells you what was renamed)
rename -v 's/FROM/TO/g'  *

This will replace the word FROM to the word TO in all file names.