[BASH][HELP] Can someone help me write a script to rename files? - Programming On Unix
Users browsing this thread: 1 Guest(s)
|
|||
Use find with -iname to use a regex to get all the files you want.
Then add a -exec at the end of find to mv the file. That would look like: Code: find location -maxdepth 1 -iname "regex here" -exec mv {} $(subquery here) \; And the subquery would do the following: Code: The Mentalist Season 1 E(1).avi Code: The Mentalist S1 E(1).avi Code: The Mentalist S1E1.avi The hard part it to replace 1 digits number by 0 concatenated with the number. |
|||
Messages In This Thread |
[BASH][HELP] Can someone help me write a script to rename files? - by neo1691 - 06-09-2014, 05:22 AM
RE: [BASH][HELP] Can someone help me write a script to rename files? - by venam - 06-09-2014, 05:45 AM
RE: [BASH][HELP] Can someone help me write a script to rename files? - by neo1691 - 06-09-2014, 06:22 AM
RE: [BASH][HELP] Can someone help me write a script to rename files? - by z3bra - 06-09-2014, 07:42 AM
RE: [BASH][HELP] Can someone help me write a script to rename files? - by neo1691 - 06-09-2014, 09:32 AM
RE: [BASH][HELP] Can someone help me write a script to rename files? - by z3bra - 06-09-2014, 01:35 PM
RE: [BASH][HELP] Can someone help me write a script to rename files? - by neo1691 - 06-09-2014, 01:38 PM
|