查看linux占用内存的前十大程序详解参数
/ 查看linux占用内存的前十大程序:查看linux占用内存的前十大程序:
ps aux | sort -k4,4nr | head -n 10
sort这一部分:
-k, --key=KEYDEF
sort via a key; KEYDEF gives location and type
k代表关键字,给定位置或者类型
-r, --reverse
reverse the result of comparisons
逆转排序,倒序输出
-n, --numeric-sort
compare according to string numerical value
比较字符值
Note that "ps -aux" is distinct from "ps aux". The POSIX and UNIX
standards require that "ps -aux" print all processes owned by a user
named "x", as well as printing all processes that would be selected by
the -a option. If the user named "x" does not exist, this ps may
interpret the command as "ps aux" instead and print a warning. This
behavior is intended to aid in transitioning old scripts and habits.
It is fragile, subject to change, and thus should not be relied upon.
下面列几条:
To see every process on the system using BSD syntax:
ps ax
ps axu
To print a process tree:
ps -ejH
ps axjf
To get info about threads:
ps -eLf
ps axms