如何使用tail和grep并获取具有结果的文件名

时间:2019-01-23 23:46:48

标签: bash grep gnu tail

我正在使用tail和grep在多个文件中找到类似“ Apple”的内容 我需要获取在其中找到结果的文件名

tail -F files_name grep --line-buffered -e 'Apple' -e 'Orange' while read ;  do    while :;    do     echo -en "\007";     sleep 1;  done  ; done

1 个答案:

答案 0 :(得分:0)

像我想得一样,看着我。

listView1_ColumnClick(object sender, ColumnClickEventArgs e)

grep 'Apple\|Orange' file1 file2 Apple中都搜索字符串Orangefile1file2将以grep作为分隔符输出文件名。您可以使用:仅打印文件名。