I have list of files what I have to rename. There is no sequence or pattern in renaming therefore I use a .txt files to do it. I can rename and copy files in separate step but I would like to combine this process into one step. The challenging part, why I am going to do it in one step, is some source file should be renamed (and copied) to multiple files.
Example:
source-file-1.jpg -> renamed-file-1.jpg
source-file-1.jpg -> renamed-file-2.jpg
source-file-1.jpg -> renamed-file-3.jpg
I use following xargs commends to rename and copy files.
xargs -a copy.txt cp -t /new-folder
xargs -a rename.txt -n 2 mv
It is possible co combine these commands? I hope if I copy files first I could achieve my goal.
No comments:
Post a Comment