Created
September 20, 2017 08:18
-
-
Save garethrees/6b7c4b81346797f5e72fa51d20ac0dff to your computer and use it in GitHub Desktop.
Sed & Awk Examples
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
| # Print column 1 | |
| awk '{print $1}' FILE | |
| # Print column 1 and 2, separated by '/' | |
| awk '{print $1 "/" $2}' FILE |
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
| # Print line 1 and 5 | |
| sed -n -e 1p -e 5p FILE |
Author
Author
Author
tail -n +2 to show all bit first line of file/stdin
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://unix.stackexchange.com/questions/64776/how-to-calculate-average-requests-per-seconds-using-awk-or-sed-on-apache-logs