头部和基部名称一起由信号13终止

时间:2015-01-22 22:35:47

标签: linux find

如何摆脱find: basename terminated by signal 13?我试过移动东西,寻找head -1的替代品,但我无法弄明白。

david@server:/hdd_1/handbrake/log$ plex="/hdd_1/plex" && find "$plex" -type f -iname "*.mkv" -exec basename {} \; | head -1
Predestination (2014).mkv
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13
find: `basename' terminated by signal 13

2 个答案:

答案 0 :(得分:0)

可能与空间有关。

试试这个:

plex="/hdd_1/plex" && find "$plex" -type f -iname "*.mkv" -print0 | xargs -0 basename | head -1

答案 1 :(得分:0)

信号13表示"断管"。 head已经得到了它所需要的东西并且已经结束了,但是basename仍在进入管道(现在无处可去,因此信号13)。

试试这个:

plex="/hdd_1/plex" && find "$plex" -type f -iname "*.mkv" | head -1 | xargs basename