//View Tip #294
» Find last modified files on a filesystem
» Print until no match
» Convert permissions to octal
» Directory Tree
jerbear
Similar Tips
» Replace expr by other recursively» Find last modified files on a filesystem
» Print until no match
» Convert permissions to octal
» Directory Tree
Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
Mass-renaming files using find and sed:
(this example will rename all .php3 files to .php)
find -name "*.php3" | sed 's/\(.*\).php3$/mv "&" "\1.php"/' | sh
(this example will rename all .php3 files to .php)
Comments
Add your comment
Comments are currently disabled
#1
most systems have the "rename" command that takes regex substitutions just like this example.
Posted 2008-09-17 13:58:48

