Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/24.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
Linux 计算使用“生成”生成的文件数;查找“;命令_Linux - Fatal编程技术网

Linux 计算使用“生成”生成的文件数;查找“;命令

Linux 计算使用“生成”生成的文件数;查找“;命令,linux,Linux,例如,我的命令是 find . -type f -name "script.log" -exec grep "finished without error" {} \; 它生成数百行输出。如何计算找到的文件数?您可以将find的输出传递到“字数”程序wc find . -type f -name "script.log" -exec grep "finished without error" {} \;| wc -l wc-l将行数写入标准输出 您可以将find的输出传递给“字数”程序wc

例如,我的命令是

find . -type f -name "script.log" -exec grep "finished without error" {} \;

它生成数百行输出。如何计算找到的文件数?

您可以将find的输出传递到“字数”程序
wc

find . -type f -name "script.log" -exec grep "finished without error" {} \;| wc -l

wc-l
将行数写入标准输出

您可以将find的输出传递给“字数”程序
wc

find . -type f -name "script.log" -exec grep "finished without error" {} \;| wc -l

wc-l
将行数写入标准输出

这回答了你的问题吗?这回答了你的问题吗?