Search code examples
unixkshaix

Unix cp argument list too long


I am using AIX.

When I try to copy all the file in a folder to another folder with the following command:

cp ./00012524/*.PDF ./dummy01

The shell complains:

ksh: /usr/bin/cp: 0403-027 The parameter list is too long.

How to deal with it? My folder contain 8xxxx files, how can I copy them very fast? each file have size of 4x kb to 1xx kb.


Solution

  • Use find command in *nix:

    find ./00012524 -type f -name "*.PDF" -exec cp {} ./dummy01/ \; -print