歡迎您光臨本站 註冊首頁

linux下查找文件內容 find+grep

←手機掃碼閱讀     火星人 @ 2014-03-26 , reply:0

小壽原創

#> find . -type f -exec grep 'mingtian' -l {} \;

grep -l :是顯示匹配的內容的文件名字!

或者:

#> find . -type f -name "*.*" |xargs grep 'xiaoshou' -l

這個方法不好,挺亂的,還慢,推薦前一個方法。

[火星人 ] linux下查找文件內容 find+grep已經有405次圍觀

http://coctec.com/docs/linux/show-post-186658.html