Hi,
I am a new guy to AWK. I have a question which is an extension to my previous one about how to search files:
let's say we have 3 directories under /usr directory. Each of the 3 directories has *.pdf files that I need to search out. For example:
/usr/d1/f1.pdf
/usr/d1/f2.pdf
/usr/d1/d11/f3.pdf
/usr/d2/f4.pdf
...
/usr/d3/d31/d32/../x.pdf
the level of the directory is as more as 10 levels.
Now I used find command find out all *.pdf files, and I also want to do this:
create a new directory called "mypdf"(it could be also under /usr), under /mypdf I want copy those matched *.pdf files into /mypdf but in the maan time i want to keep the same directory structure as before, for example:
after the operation, i will have:
/usr/mypdf/d1/f1.pdf
/usr/mypdf/d1/f2.pdf
/usr/mypdf/d1/d11/f3.pdf
/usr/mypdf/d2/f4.pdf
etc. In other words, i want to maintain the original file structrue.
Since the original file structure is too big and too many matched files, I can't do that by hand.
Anyone can help me out?
I am a new guy to AWK. I have a question which is an extension to my previous one about how to search files:
let's say we have 3 directories under /usr directory. Each of the 3 directories has *.pdf files that I need to search out. For example:
/usr/d1/f1.pdf
/usr/d1/f2.pdf
/usr/d1/d11/f3.pdf
/usr/d2/f4.pdf
...
/usr/d3/d31/d32/../x.pdf
the level of the directory is as more as 10 levels.
Now I used find command find out all *.pdf files, and I also want to do this:
create a new directory called "mypdf"(it could be also under /usr), under /mypdf I want copy those matched *.pdf files into /mypdf but in the maan time i want to keep the same directory structure as before, for example:
after the operation, i will have:
/usr/mypdf/d1/f1.pdf
/usr/mypdf/d1/f2.pdf
/usr/mypdf/d1/d11/f3.pdf
/usr/mypdf/d2/f4.pdf
etc. In other words, i want to maintain the original file structrue.
Since the original file structure is too big and too many matched files, I can't do that by hand.
Anyone can help me out?