diff --git a/README.md b/README.md index 7888183..a1e2979 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ variety of languages and technologies. These are things that don't really warrant a full blog post. These are mostly things I learn by pairing with smart people at [Hashrocket](http://hashrocket.com/). -_449 TILs and counting..._ +_450 TILs and counting..._ --- @@ -403,6 +403,7 @@ _449 TILs and counting..._ - [Last Argument Of The Last Command](unix/last-argument-of-the-last-command.md) - [Less With Style](unix/less-with-style.md) - [List All Users](unix/list-all-users.md) +- [List Names Of Files With Matches](unix/list-names-of-files-with-matches.md) - [List Of Sessions To A Machine](unix/list-of-sessions-to-a-machine.md) - [Only Show The Matches](unix/only-show-the-matches.md) - [Open The Current Command In An Editor](unix/open-the-current-command-in-an-editor.md) diff --git a/unix/list-names-of-files-with-matches.md b/unix/list-names-of-files-with-matches.md new file mode 100644 index 0000000..36d1c4c --- /dev/null +++ b/unix/list-names-of-files-with-matches.md @@ -0,0 +1,13 @@ +# List Names Of Files With Matches + +I often use `grep` and `ag` to search for patterns in a group or directory +of files. Generally I am interested in looking at the matching lines +themselves. However, sometimes I just want to know the set of files that +have matches. Both `grep` and `ag` can be told to output nothing more than +the names of the files with matches when given the `-l` flag. + +This can come in particularly handy if you just want a list of files that +can be piped (or copied) for use with another command. This eliminates all +the extra noise. + +h/t Dillon Hafer