Skip to content

Instantly share code, notes, and snippets.

@sae13
Last active November 25, 2019 11:55
Show Gist options
  • Save sae13/06785dd2a23898e648673318492db6fe to your computer and use it in GitHub Desktop.
Save sae13/06785dd2a23898e648673318492db6fe to your computer and use it in GitHub Desktop.
bash examples
ip a|awk '{if ($1 ~ /^[0-9]:/) print $1 ; if (/inet/) print $2}'
1:
127.0.0.1/8
::1/128
2:
172.16.6.164/24
fe80::681a:78de:211:28d2/64
3:
192.168.122.1/24
4:
ps aux|awk '{if ($11 ~ /^ping*/) print $2}'|xargs kill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment