Im looking to use the
rename command to edit file names. More specifically, Im trying to isolate specific pieces to change, or in some cases, the whole name.
Lets say I have three directories… (test-file-1, example2, third)
If I wanted to change "test-file-1" to "file 1"
I know I could use
rename 's/test-file-1/file 1/' *
How could I set a wild card so I dont have to give the explicit file name to be changed?
rename 's/tes*/file 1/' *to no avail
Similarly, I would like to know if it's possible to change the whole file name using wildcards.
rename 's/^*/file 1/' test*
Im not entirely sure if I can use the second asterisk to match the files to be processed or not but the same question applies to that as well.