shell cmd example

get ip address:

    LANG=C ip a show eth0 | grep 'inet' | grep -v 'inet6' | awk '{print $2;}' | cut -d'/' -f1`

get terminal user:

    who | awk -F '(' '{print $2}'| awk -F ')' '{print $1}' | sort | uniq | wc -l

 

posted on 2016-05-24 15:37  yaoweilei  阅读(128)  评论(0编辑  收藏  举报

导航