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.
If there are a large number of files in a single directory, Then the traditional rm command can not delete all files and ends with an error message Argument list too long . To resolve this issue and delete all files use xargs command-line utility with the find command.
There are a number of solutions to this problem (bash: /usr/bin/rm: Argument list too long). Remove the folder itself then recreate it. If you still need that directory, then recreate with the mkdir command.
/bin/grep: Argument list too long. A second option to overcome the error is: substitute the “ * ” (asterisk) with a “ . ” (dot), like: grep -r "example\.com" . In newer versions of grep you can omit the “ .
You use the cp command for copying files from one location to another. This command can also copy directories (folders). [file/directory-sources] specifies the sources of the files or directories you want to copy. And the [destination] argument specifies the location you want to copy the file to.
Use find command in *nix:
find ./00012524 -type f -name "*.PDF" -exec cp {} ./dummy01/ \; -print
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With