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:
@@ -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)
|
||||
|
||||
22
unix/search-files-specific-to-a-language.md
Normal file
22
unix/search-files-specific-to-a-language.md
Normal 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.
|
||||
Reference in New Issue
Block a user