Here’s a little trick when you need to mass rename files in Unix: for example, if you have a bunch of files where you need to replace the word “foo” with “bar” you can do as such:
1 |
for f in `ls *`; do mv "$f" "${f/foo/bar}"; done |
Visitors give this article an average rating of 4.0 out of 5.
How would you rate this article?
★ ★ ★ ★ ★
Or use rename -v ‘s/foo/bar/ *
Something like that 😉