This is an example how to rename files with regex.
At first we need to create some files:
1 2 |
`touch {1,2}OLD.txt`; `touch {1,2}TEST.txt`; |
Lets look what we got:
1 2 |
sh-4.2# ls 1OLD.txt 1TEST.txt 2OLD.txt 2TEST.txt |
now rename this files:
1 |
rename 's/OLD/NEW/' *.txt |
And we see the renamed files:
1 2 |
sh-4.2# ls 1NEW.txt 1TEST.txt 2NEW.txt 2TEST.txt |