how to select and copy multiple directories
Hi
I want to copy multiple directories with one cp command. Code:
-rw-r--r--. 1 1000 1000 37040 Jul 10 20:01 cherrytree.pot I know it would be done by using xargs,but I don't know how to use it. Is there any way to achieve this goal? please guide me. thank you |
@ Reply
Hi there,
You can do that using following command: cp -arv directory1 directory2 directory3 /destination-directory Make sure that you run this command from the location where the source directories are located. I hope this helps. |
Thank you
Is there any solution by using xargs command? |
@ Reply
Yes there is a way but a bit confusing. The one mentioned above is easy. If you still want to try then following is the command:
Code:
find / -name name_of_destination_directory -print | xargs /bin/cp -arv source_directory1_with_full_path source_directory2_with_full_path source_directory3_with_full_path |
All times are GMT -5. The time now is 08:03 PM. |