
文章链接
脚本语言-shell-grep、awk、sed
面5笔5找出当前目录下包含127.0.0.1关键字的文件?
方法1
grep "127.0.0.1" ` find -type f `
sed -n '/127.0.0.1/p' ` find -type f`
awk '/127.0.0.1/' ` find -type f`
方法2
find -type f | xargs grep "127.0.0.1"
find -type f | xargs sed -n '/127.0.0.1/p'
find -type f | xargs awk '/127.0.0.1/'
方法3
find -type f -exec grep "127.0.0.1" {} \
find -type f -exec sed -n '/127.0.0.1/p' {} \
find -type f -exec awk '/127.0.0.1/' {} \