Skip to content

Instantly share code, notes, and snippets.

@TerryFunggg
Last active April 8, 2021 04:52
Show Gist options
  • Save TerryFunggg/71a23e8e5d44ec188f4bc18fd09df8d0 to your computer and use it in GitHub Desktop.
Save TerryFunggg/71a23e8e5d44ec188f4bc18fd09df8d0 to your computer and use it in GitHub Desktop.
Find specific text by given directory in linux
grep -Ril "text-want-to-find" <directory>
# -i for ignore case
# -R for recursive
# -l for show the file name
# Example:
# In my case, I forgot the location of my mirrors config
# but I remember what mirrors i used
grep -Ril "aliyun" /etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment