-1

i am using below command to enlist the direcoties with name containing linuxS_x86 .

" find src/ -type d -name 'linuxS_x86' "

it is giving correct output also. Now i want to copy the files from the all the directories enlisted with above command .

Please help me out ..?

1 Answers1

0

use find with -exec

find src/ -type d -name 'linuxS_x86' -exec cp -rf {} <some destination> \;

{} is the placeholder to pass a single file name to -exec called command, and \; is to finish -exec.


or else you could use ls instead of find. Then pass found files to xargs to do cp command.

ls linuxS_x86/* | xargs -n 1 -I{} cp {} ./bbb
mariolu
  • 624
  • 8
  • 17