Scripts that deserve to live in ~/bin
Perl script to rename files using a text file to record the new filenames. To use it you would do something like:
Save a file list:
files.txtwherever you want but don't change the files order.
See how the files would be renamed:
If everything looks right you can add the
-eswitch to apply the changes:
rename-batch -l -e
Perl script to rename files using regular expressions. Some examples of use would be:
Replace underscores with spaces in all filenames:
rename-regexp -s 's/_/ /'
Replace underscores with spaces in filenames that end in
rename-regexp -s 's/_/ /' -m 'm/\.pdf$/'
Recursively replace underscores with spaces and change filenames case to lower:
rename-regexp -s 'tr/_[A-Z]/ [a-z]/' -r
To apply the changes you need to add the
rename-regexp -s 'tr/_[A-Z]/ [a-z]/' -r -e
Bash script to mount an external disk, backup a local filesystem using rsync, tweet about it and umount the external disk.
To setup your backup first review the configuration section of the
script. To test your setup you can add
To enable tweeting the backup stats you should install bti, create a twitter application and pair it with your bti configuration.
Manuel Rábade <email@example.com>
This work is published under a MIT License.