Created
April 8, 2019 08:23
-
-
Save codeasashu/78c6962223a78a3c3ef40c153952588f to your computer and use it in GitHub Desktop.
Some better Regexes
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
1. Extract all (PHP) requests from apache access.log: | |
grep -Eo '"POST /[a-zA-Z0-9_ ]+/[a-zA-Z0-9_]+.php HTTP/1.1"' access.log | |
2. find all urls in a folder across all files: | |
grep -rnEo "(http|https)://[a-zA-Z0-9./?=_-]*" folder/ | |
3. SED delete range of lines in a huge text files: | |
sed -i '21,141d' file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment