Tag Archive: batch rename

May 31

Shell programming trap: batch rename with find

When we want to rename all files under the current directory and its sub-directories, say renaming files with .shell suffix to those with .sh suffix. we may write this command: find . -name "*.shell" -exec mv {} $(echo {} | sed -e ‘s/\.shell$/.sh/’) \; Here, find will replace all occurrence of “{}” with  the current …

Continue reading »