Wednesday, March 24, 2010

Mitch's list of really incredibly useful commands...

This thread is simply a list of commands that I use from time to time, which are really useful, but long enough that I won't remember them when I need them.

Please note: for the rename examples below to work, you must be using the Perl version of rename, such as the one included in Debian (and derivative) distributions. The Redhat Enterprise Linux version of rename is different and is almost useless.

Rename files to add leading zeros (in this case followed by a letter)
Code:
$rename -nv 's/^([1-9])([a-z])/0$1$2/' /mydir/*

note: remove the 'n' argument to actually change the filenames.

in reference to:

"This thread is simply a list of commands that I use from time to time, which are really useful, but long enough that I won't remember them when I need them.Please note: for the rename examples below to work, you must be using the Perl version of rename, such as the one included in Debian (and derivative) distributions. The Redhat Enterprise Linux version of rename is different and is almost useless.Rename files to add leading zeros (in this case followed by a letter)"
- Ithaca Free Software GNU Linux • View topic - Mitch's list of really incredibly useful commands... (view on Google Sidewiki)

2 comments:

佩璇 said...

原來這世上能跟你共同領略一個笑話的人竟如此難得........................................

fundoo said...

Thanks for the information, we will add this story to our blog, as we have a audience in this sector that loves reading like this” web development