Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2018年09月10日 grep 遍历文件夹查找文本内容 #44

Open
imzyf opened this issue Sep 10, 2018 · 0 comments
Open

2018年09月10日 grep 遍历文件夹查找文本内容 #44

imzyf opened this issue Sep 10, 2018 · 0 comments

Comments

@imzyf
Copy link
Contributor

imzyf commented Sep 10, 2018

有时候我们需要在某一个包含很多子目录的目录中搜索查找包含某个文本内容的文本,我们可以在grep中加上 -r选项让grep命令迭代进入子目录查找。同时在命令最后加上代表文件通配符的*号,不然grep会一直等待输入。命令方式如下所示:

grep -r "查找文本内容" *  

http://james23dier.iteye.com/blog/784803

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant