1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 07:08:01 +00:00

Add Search Files Specific To A Language as a unix til

This commit is contained in:
jbranchaud
2016-11-16 14:59:10 -06:00
parent 540194450d
commit f580c8ee9b
2 changed files with 24 additions and 1 deletions

View File

@@ -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/).
_484 TILs and counting..._
_485 TILs and counting..._
---
@@ -444,6 +444,7 @@ _484 TILs and counting..._
- [PID Of The Current Shell](unix/pid-of-the-current-shell.md)
- [Repeat Yourself](unix/repeat-yourself.md)
- [Saying Yes](unix/saying-yes.md)
- [Search Files Specific To A Language](unix/search-files-specific-to-a-language.md)
- [Search History](unix/search-history.md)
- [Search Man Page Descriptions](unix/search-man-page-descriptions.md)
- [Securely Remove Files](unix/securely-remove-files.md)

View File

@@ -0,0 +1,22 @@
# Search Files Specific To A Language
The `ack` command makes it easy to narrow the set of searched files to those
of a specific programming language. For instance, if you have a rails
project and only want to search the ruby files, use the `--ruby` flag with
your `ack` command.
```bash
$ ack --ruby Active
```
With the `--ruby` flag, I get a manageable number of results. Without it,
not so much.
```bash
$ ack --ruby Active | wc -l
26
$ ack Active | wc -l
5253
```
See `man ack` for more details.