To understand recursive grep in xargs

妖精的绣舞 提交于 2019-12-02 08:39:55

问题


What is the practical difference between the following two commands?

Command A

find . -type f -print0 | xargs -0 grep -r masi       

Command B

find . -type f -print0 | xargs -0 grep masi 

In short, what is the practical benefit of Command A?


回答1:


None .. -r is for recursively searching directories, but the -type f will prevent find from returning directory names.




回答2:


I think none The A will try to recurse over file names (as the find is only searching for files) so it will not recurse into anything...



来源:https://stackoverflow.com/questions/1121807/to-understand-recursive-grep-in-xargs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!