我有一个人写的下面的代码片段,但是我不明白sort -t' ' -rn +2 -3是做什么的。
ps aux|tr -s ' '|cut -f1-3,11 -d' '|grep $USER|sort -t' ' -rn +2 -3|cut -f2 -d' '|head -5尤其是+2和-3选项。我知道-r代表反向,而-n代表数字。
发布于 2015-02-26 02:59:41
这个命令做了很多不必要的工作。您可以使用pgrep将其替换为以下命令
pgrep -U"$USER" | sort -r | head -5顺便说一句,为了简单地理解sort -t' ' -rn +2 -3是什么意思,你应该遵循@1_CR在你的问题下面的评论。
https://stackoverflow.com/questions/28726736
复制相似问题