0

I need to copy files with the same name in multiple directories to their same places,

For Example, Files are as follows:

/var/Aug/test /var/Sep/test /var/Oct/test 

And I need to copy them to their own places but named test_1

/var/Aug/test_1 /var/Sep/test_1 /var/Oct/test_1 

if I run ls command

ls /var/Aug 

Output should be:

test test_1 

1 Answer 1

1

give this a try:

 find . -name 'test'|xargs -I{} cp {} "{}_1" 
Sign up to request clarification or add additional context in comments.

1 Comment

I did it with a simple loop script

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.