以递归方式查找文件

在示例中,查找并显示/etc中包含字符串nameserver的每个文件以及相应的行
.

0

linux命令:find /etc -type f -print0 2>/dev/null | xargs -0 grep --color=AUTO -Hn 'nameserver' 2>/dev/null 2>/dev/null 'nameserver' -Hn --color=AUTO grep -0 xargs | 2>/dev/null -print0 f -type /etc find find /etc -type f -print0 2>/dev/null | xargs -0 grep --color=AUTO -Hn 'nameserver' 2>/dev/nullrootopen.com
linux命令:find /etc -type f -print0 2>/dev/null | xargs -0 grep --color=AUTO -Hn 'nameserver' 2>/dev/null 2>/dev/null 'nameserver' -Hn --color=AUTO grep -0 xargs | 2>/dev/null -print0 f -type /etc find find /etc -type f -print0 2>/dev/null | xargs -0 grep --color=AUTO -Hn 'nameserver' 2>/dev/nullrootopen.com
jemp 2019-01-06 22:12:10
输出
/etc/ppp/ip-up.d/0dns-up:9:# Rev. Dec 22 1999 to put dynamic nameservers last.
/etc/ppp/ip-up.d/0dns-up:23:# nameservers given by the administrator. Those for which 'Dynamic' was chosen
/etc/ppp/ip-up.d/0dns-up:24:# are empty. 0dns-up fills in the nameservers when pppd gets them from the
/etc/ppp/ip-up.d/0dns-up:26:# 'search' or 'domain' directives or additional nameservers. Read the
/etc/ppp/ip-up.d/0dns-up:77:# nameserver lines to the temp file.

评论

相关推荐
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

热门文章