linux命令学习2

排序: sort  -n -k 1,-n表示按照数字排序,-k 1表示按照第一列排序,-t后面指定分隔符

删除第一行: sed 1d

ps命令直接排序: ps aux –sort=rss

awk汇总: awk ‘BEGIN {total = 0}  {total += $6} END {print total} ‘


2013-08-23追加

输出指定行:
sed -n '15q;11,14p' test.txt

Comments are closed.