Skip to content

Instantly share code, notes, and snippets.

@oliveagle
Created May 28, 2015 15:17
Show Gist options
  • Save oliveagle/5675f4f4390c8d5638a5 to your computer and use it in GitHub Desktop.
Save oliveagle/5675f4f4390c8d5638a5 to your computer and use it in GitHub Desktop.
some linux command tips
# 统计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}'
# 比较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