Last active
August 29, 2023 01:31
-
-
Save namgivu/9de9f7e19f05e073af165af63045a79f to your computer and use it in GitHub Desktop.
bash command search file or folder contain specific text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: search file containing specific text | |
YOUR_TEXT='YOUR_TEXT'; grep -R . -iE $YOUR_TEXT | cut -d':' -f1 | sort -u | |
# ref. https://stackoverflow.com/a/16957078/248616 https://unix.stackexchange.com/a/9923/17671 | |
: search filename | |
find . -name "*YOUR TEXT*" | |
# ref. https://unix.stackexchange.com/a/248763/17671 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment