天天看点

grep 和find 结合

用grep命令在所有的普通文件中搜索hostname这个词:

# find . -type f -print | xargs grep "hostname" ./httpd1.conf:#     different IP addresses or hostnames and have them handled by the ./httpd1.conf:# VirtualHost: If you want to maintain multiple domains/hostnames on your

用grep命令在当前目录下的所有普通文件中搜索hostnames这个词:

# find . -name /* -type f -print | xargs grep "hostnames" ./httpd1.conf:#     different IP addresses or hostnames and have them handled by the ./httpd1.conf:# VirtualHost: If you want to maintain multiple domains/hostnames on your

继续阅读