Imagine a directory structure that looks like :
/a1/b1/c1/O
/a1/b2/c2/O
/a1/b3/c3/O
how do I copy all content of the "O" directory to one file?
I've tried cp -r /a1/*/O ~/O
and it fails
Imagine a directory structure that looks like :
/a1/b1/c1/O
/a1/b2/c2/O
/a1/b3/c3/O
how do I copy all content of the "O" directory to one file?
I've tried cp -r /a1/*/O ~/O
and it fails
One more glob pattern needed. Use:
cp -r /a1/*/O/* ~/O
OR to make this command work for any depth use find
:
find /a1 -type d -name 'O' -print0 | xargs -0 -I % cp -r %/* ~/O