Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/36.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
';头部';由信号13 Unix错误终止_Unix - Fatal编程技术网

';头部';由信号13 Unix错误终止

';头部';由信号13 Unix错误终止,unix,Unix,正在尝试列出~/UnixCourse目录中所有文本文件的第一行。我打字的时候 代码: 我得到这个错误: find: 'head' terminated by signal 13 我觉得我已经接近解决方案了。如有任何建议,将不胜感激。答案也必须是单行的这对我来说在OS X 10.10和Debian上都适用: find ~/UnixCourse -type f -name "*.txt" -print -exec head -1 {} \; 但是我需要在那里打印每个目录,然后打印文本文件的第一行

正在尝试列出~/UnixCourse目录中所有文本文件的第一行。我打字的时候

代码:

我得到这个错误:

find: 'head' terminated by signal 13

我觉得我已经接近解决方案了。如有任何建议,将不胜感激。答案也必须是单行的

这对我来说在OS X 10.10和Debian上都适用:

find ~/UnixCourse -type f -name "*.txt" -print -exec head -1 {} \;

但是我需要在那里打印每个目录,然后打印文本文件的第一行。示例:/home/yourname/UnixCourse/foo.txt在人类发展过程中,好吧,这就是你现在想要的。您需要在文件名匹配后打印,因此它只打印包含您正在查找的文件的目录。我很抱歉,是的,您是对的!我重新检查了我输入的内容,跳过了打印。谢谢您。有趣的是,打印的位置将改变一切
find ~/UnixCourse -type f -name "*.txt" -print -exec head -1 {} \;