This small, bash script will loop though the specified files and rename them according to a sed regular expression. In this example, I'm renaming a bunch of .avi movie files.
- for i in *.avi
- j=`echo $i | sed 's/find/replace/g'`
- mv "$i" "$j"
- Can also be written on a single line as
- for i in *.avi; do j=`echo $i | sed 's/find/replace/g'`; mv "$i" "$j"; done
CommentsSubscribe to comments
You need to login to post a comment.