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

原文地址:https://www.cnblogs.com/yaoweilei/p/5523596.html