Created
May 28, 2015 15:17
-
-
Save oliveagle/5675f4f4390c8d5638a5 to your computer and use it in GitHub Desktop.
some linux command tips
This file contains 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
# 统计nginx日志不同ip的访问次数 | |
awk '{print $1}' access.log | sort | uniq -c | |
# 统计nginx 日志有多少个不同的ip访问 | |
awk '{print $1}' access.log | sort -u | |
# skip first line | |
awk 'NR>1 {PRINT $1}' |
This file contains 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
# 比较binary文件的异同 | |
cmp -l file1.bin file2.bin | gawk '{printf "%08X %02X %02X\n", $1, strtonum(0$2), strtonum(0$3)}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment