Val Krem
2017-04-30 00:36:15 UTC
Hi all,
I have several files with the same extension name(*.txt). I want to have copy of these files by attaching a suffix to each of the files. Example test1.txt should be copied to test1_new.txt. The suffix to be added in all files is the same. I tried using this but did not work.
ls *.txt | xargs -I {} cp {} {}_new.txt
test.txt should be test_new.txt
but I got test.txt_new.txt
what should I do to make work?
Thank you in advance
I have several files with the same extension name(*.txt). I want to have copy of these files by attaching a suffix to each of the files. Example test1.txt should be copied to test1_new.txt. The suffix to be added in all files is the same. I tried using this but did not work.
ls *.txt | xargs -I {} cp {} {}_new.txt
test.txt should be test_new.txt
but I got test.txt_new.txt
what should I do to make work?
Thank you in advance