2
0
I'm working on a CentOS server and I have to move around and cat together millions of files. I've tried many incarnations of something like the below, but all of them fail with an argument list too long error.
command:
find ./ -iname out.* -type f -exec mv {} /home/user/trash
find ./paramsFile.* -exec cat > parameters.txt
error:
-bash: /usr/bin/find: Argument list too long
-bash: /bin/cat: Argument list too long
or
echo ./out.* | xargs -I '{}' mv /home/user/trash
(echo ./paramsFile.* | xargs cat) > parameters.txt
error:
xargs: argument line too long
xargs: argument line too long
The second command also never finished. I've heard some things about globbing, but I'm not sure I understand it completely. Any hints or suggestions are welcome!
2You don't have to put
{}
between quotes for filename security! Without quotes is perfect unless your shell does weird stuff with it. – gniourf_gniourf – 2013-07-10T06:39:01.323