15 lines
488 B
Markdown
15 lines
488 B
Markdown
---
|
|
title: "Find Text in Files on Linux"
|
|
date: 2022-12-24T14:40:55-03:00
|
|
draft: false
|
|
tags: ['linux']
|
|
---
|
|
|
|
I ~~shamelessly copied from~~ found [on stackoverflow.com](https://stackoverflow.com/a/16957078) how to use `grep` to find a specific text (or [regular expression](https://en.wikipedia.org/wiki/Regular_expression)) inside a directory:
|
|
|
|
```bash
|
|
grep -rnw '/path/to/somewhere/' -e 'pattern'
|
|
```
|
|
|
|
And I think that's very useful for coders when trying to find references from a class.
|