MiscMisc

A quick bash tip: find files containing specific text

Aug 21, 2019 · by Tim Kamanin

This command works on both Linux and Mac:

bash
grep -Rl --include \*.py 'search_vector' ./

In my case I'm looking for 'search_vector' text in my python code files. As a result, I'll get a list of files that contain the text.

Hey, if you've found this useful, please share the post to help other folks find it:

There's even more:

Subscribe for updates

  • via Twitter: @timonweb
  • old school RSS:
  • or evergreen email ↓ ↓ ↓