Skip to content

Instantly share code, notes, and snippets.

@bstonedev
Last active January 13, 2023 04:44
Show Gist options
  • Save bstonedev/4b5dd94c902975002ad9b57c0ec1624f to your computer and use it in GitHub Desktop.
Save bstonedev/4b5dd94c902975002ad9b57c0ec1624f to your computer and use it in GitHub Desktop.
Grep command for searching for files in linux server
#find files that have certain string
grep -rnl '/home/directory' -e 'string_you_want_to_search'
#find lines that have certain string
grep 'string_you_want_to_search' '/file/path'
#find IP Address for Logs in Cloudways Application
find /home/app-directory/logs/php-app.access.log* -type f -exec grep "IP_ADDRESS" {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment