Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
unix-如何为cat处理过多的参数_Unix_Arguments_Cat - Fatal编程技术网

unix-如何为cat处理过多的参数

unix-如何为cat处理过多的参数,unix,arguments,cat,Unix,Arguments,Cat,我在一个目录中有一堆文件,每个文件都有一行文本。我想将所有这些文件(所有一行程序)合并到一个大文件中。但是,当我使用cat时,参数太多。我怎样才能避开这个问题?查看xargs find . <whatever> | xargs cat > outfile.txt find.|xargs cat>outfile.txt 更换find按自己的方式获取所有文件 用输出文件替换outfile.txt。尝试将-n与xargs一起使用,以减少传递给cat的参数数量 bash$ (ls

我在一个目录中有一堆文件,每个文件都有一行文本。我想将所有这些文件(所有一行程序)合并到一个大文件中。但是,当我使用
cat
时,参数太多。我怎样才能避开这个问题?

查看
xargs

find . <whatever> | xargs cat > outfile.txt
find.|xargs cat>outfile.txt
更换
find按自己的方式获取所有文件


用输出文件替换outfile.txt。

尝试将-n与xargs一起使用,以减少传递给cat的参数数量

bash$ (ls | xargs cat) > /tmp/some_big_file
find .|xargs -n 100 cat >> out