Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
locate 'filename' | grep 'pattern'定位文件然后 greps 他们的文件名。我想 grep 文件的内容。
locate 'filename' | grep 'pattern'
您必须将文件名作为参数传递给 grep:
grep 'pattern' $(locate 'filename')
($(...)将评估命令并返回它的标准输出)
$(...)