UNIX allows users to pipe each utility’s output to another utility’s input to accomplish complicated tasks.
Find command with -exec
|
|
We first find txt file in this directory. Then, execute grep and substitute {} with the results we just found. That is, the filenames.
Result
|
|
If we want to display the filename the matched lines are in, we can change the command above to
|
|
近期评论