Last active
January 13, 2023 04:44
-
-
Save bstonedev/4b5dd94c902975002ad9b57c0ec1624f to your computer and use it in GitHub Desktop.
Grep command for searching for files in linux server
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
#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