ps -ef | grep java | grep -v grep | awk ‘{print $1}‘
ps -ef | grep java | grep -v grep | awk ‘{print $1,$2}‘
ps -ef | grep java | grep -v grep | awk ‘{print $1 $2}‘
ps -ef | grep java | grep -v grep | awk ‘END{print NR-1}‘
ps -ef | grep java | grep -v grep | awk ‘NR==1{print}‘
原文:https://www.cnblogs.com/iuskye/p/awk-line.html