Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /usr/bin/env bash
- find . -exec grep chrome {} +
- #find will execute grep and will substitute {} with the filename(s) found. The difference between ; and + #is that with ; a single grep command for each file is executed whereas with + as many files as possible #are given as parameters to grep at once.
- If you use the \; ending construct grep is passed one file at a time, so it doesn't display the file name by default, only the matched lines. To get a file list instead add use grep -ls inside of the find construct.
- find . -exec grep foo {} + will show you output like this ./dir/file.py:from foo import bar – s g Apr 17 '15 at 20:30
- find . -exec grep foo {} \; will show you output like this from foo import bar – s g Apr 17 '15 at 20:31
- find . -exec grep -l foo {} + will show you output like this ./dir/file.py – s g Apr 17 '15 at 20:32
- find . -exec grep -l foo {} \; will show you output like this ./dir/file.py – s g Apr 17 '15 at 20:33
Add Comment
Please, Sign In to add comment