Copying first 1000 PDF files having single, double quotes in their name to another folder

Posted by racer_ace on Ask Ubuntu See other posts from Ask Ubuntu or by racer_ace
Published on 2014-08-22T08:08:55Z Indexed on 2014/08/22 10:27 UTC
Read the original article Hit count: 204

Filed under:

I am having this folder with PDFs into it and I need to process 1000 at a time. So I need to move them into another folder, process them and delete them. For this I tried using

$ find . -maxdepth 1 -type f |head -1000|xargs cp -t $destdir

It gives error on single and double quotes in filename. There are thousands of files and I have no idea how many of them has these quotes in them.

Can anyone help me find a solution?

And I tried with the -0 option, it did not work

© Ask Ubuntu or respective owner

Related posts about pdf