linux ps 关于sort的解释

--sort spec  specify sorting order. Sorting syntax is [+|-]key[,[+|-]key[,...]]
Choose a multi-letter key from the STANDARD FORMAT SPECIFIERS section.
The "+" is optional since default direction is increasing numerical or
lexicographic order. Identical to k. For example: ps jax --sort=uid,-ppid,+pid

ps aux --sort -rss

输出
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
mysql 0.0 1.7 ? Sl Oct21 : /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysq
root 0.0 1.0 ? Ssl Oct21 : /usr/bin/python -E /usr/sbin/setroubleshootd
root 0.0 0.9 ? SN Oct21 : /usr/bin/python -tt /usr/sbin/yum-updatesd
root 0.0 0.9 ? Ss Oct21 : /usr/sbin/restorecond
root 0.0 0.6 ? Ss Oct21 : /usr/local/apache2/bin/httpd -k start
nobody 0.0 0.6 ? S Oct21 : /usr/local/apache2/bin/httpd -k start
nobody 0.0 0.6 ? S Oct21 : /usr/local/apache2/bin/httpd -k start
nobody 0.0 0.6 ? S Oct21 : /usr/local/apache2/bin/httpd -k start
nobody 0.0 0.6 ? S Oct21 : /usr/local/apache2/bin/httpd -k start
nobody 0.0 0.6 ? S Oct21 : /usr/local/apache2/bin/httpd -k start
0.0 0.3 ? Ss Oct21 : hald
root 0.0 0.2 ? Ss : : sshd: root@pts/
root 0.0 0.2 ? Ss Oct21 : cupsd
root 0.0 0.1 ? Ss Oct21 : sendmail: accepting connections
root 0.0 0.1 ? S<s Oct21 : /sbin/udevd -d

ps 命令排序说明


有许多方法可以对ps命令输出进行排序,您可以在Linux ps命令手册页中找到所有这些方法。我已经减少了ps手册页中的一些说明,以显示我认为最重要的排序键。
STANDARD FORMAT SPECIFIERS

Here are the different keywords that may be used to control the output format (e.g. with option -o) or to sort the
selected processes with the GNU-style --sort option. For example: ps -eo pid,user,args --sort user This version of ps tries to recognize most of the keywords used in other implementations of ps. The following user-defined format specifiers may contain spaces: args, cmd, comm, command, fname, ucmd, ucomm, lstart,
bsdstart, start. Some keywords may not be available for sorting. CODE HEADER DESCRIPTION %cpu %CPU cpu utilization of the process in "##.#" format. Currently, it is the CPU time used divided by the
time the process has been running (cputime/realtime ratio), expressed as a percentage. It will not
add up to 100% unless you are lucky. (alias pcpu). %mem %MEM ratio of the process’s resident set size to the physical memory on the machine, expressed as a
percentage. (alias pmem). bsdstart START time the command started. If the process was started less than 24 hours ago, the output format is
" HH:MM", else it is "mmm dd" (where mmm is the three letters of the month). bsdtime TIME accumulated cpu time, user + system. The display format is usually "MMM:SS", but can be shifted to
the right if the process used more than 999 minutes of cpu time. c C processor utilization. Currently, this is the integer value of the percent usage over the lifetime
of the process. (see %cpu). comm COMMAND command name (only the executable name). Modifications to the command name will not be shown.
A process marked <defunct> is partly dead, waiting to be fully destroyed by its parent. The output
in this column may contain spaces. (alias ucmd, ucomm). See also the args format keyword, the -f
option, and the c option.
When specified last, this column will extend to the edge of the display. If ps can not determine
display width, as when output is redirected (piped) into a file or another command, the output
width is undefined. (it may be 80, unlimited, determined by the TERM variable, and so on) The
COLUMNS environment variable or --cols option may be used to exactly determine the width in this
case. The w or -w option may be also be used to adjust width. command COMMAND see args. (alias args, cmd). cp CP per-mill (tenths of a percent) CPU usage. (see %cpu). cputime TIME cumulative CPU time, "[dd-]hh:mm:ss" format. (alias time). egroup EGROUP effective group ID of the process. This will be the textual group ID, if it can be obtained and
the field width permits, or a decimal representation otherwise. (alias group). etime ELAPSED elapsed time since the process was started, in the form [[dd-]hh:]mm:ss. euid EUID effective user ID. (alias uid). euser EUSER effective user name. This will be the textual user ID, if it can be obtained and the field width
permits, or a decimal representation otherwise. The n option can be used to force the decimal
representation. (alias uname, user). gid GID see egid. (alias egid). lstart STARTED time the command started. ni NI nice value. This ranges from 19 (nicest) to -20 (not nice to others), see nice(1). (alias nice). pcpu %CPU see %cpu. (alias %cpu). pgid PGID process group ID or, equivalently, the process ID of the process group leader. (alias pgrp). pid PID process ID number of the process. pmem %MEM see %mem. (alias %mem). ppid PPID parent process ID. rss RSS resident set size, the non-swapped physical memory that a task has used (in kiloBytes).
(alias rssize, rsz). ruid RUID real user ID. size SZ approximate amount of swap space that would be required if the process were to dirty all writable
pages and then be swapped out. This number is very rough! start STARTED time the command started. If the process was started less than 24 hours ago, the output format is
"HH:MM:SS", else it is " mmm dd" (where mmm is a three-letter month name). sz SZ size in physical pages of the core image of the process. This includes text, data, and stack
space. Device mappings are currently excluded; this is subject to change. See vsz and rss. time TIME cumulative CPU time, "[dd-]hh:mm:ss" format. (alias cputime). tname TTY controlling tty (terminal). (alias tt, tty). vsz VSZ virtual memory size of the process in KiB (1024-byte units). Device mappings are currently
excluded; this is subject to change. (alias vsize).
												

linux ps 按进程消耗内存资源大小排序的更多相关文章

  1. ps - 按进程消耗内存多少排序

    https://www.cnblogs.com/JemBai/archive/2011/06/21/2086184.html https://www.cnblogs.com/jiqing9006/p/ ...

  2. linux ps查看进程命令

    linux ps查看进程命令ps命令作用:将某个时间点的程序运作情况撷取下来 实例: [root@linux ~]# ps aux [root@linux ~]# ps -lA [root@linux ...

  3. linux下对进程按照内存使用情况进行排序

    linux下对进程按照内存使用情况进行排序的命令为:ps aux --sort -rss 详细解说参见 http://alvinalexander.com/linux/unix-linux-proce ...

  4. Linux 查看进程消耗内存情况总结

    在Linux中,有很多命令或工具查看内存使用情况,今天我们来看看如何查看进程消耗.占用的内存情况,Linux的内存管理和相关概念要比Windows复杂一些.在此之前,我们需要了解一下Linux系统下面 ...

  5. linux ps查看进程命令详解

    http://linux.net527.cn/Linuxwendang/xitongguanliyuan/39094.htmlLinux操作系统PS命令详细解析 要对系统中进程进行监测控制,用 ps ...

  6. Linux中查看进程占用内存的情况【转】

    转自:http://hutaow.com/blog/2014/08/28/display-process-memory-in-linux/ Linux中查看某个进程占用内存的情况,执行如下命令即可,将 ...

  7. crond守护进程实现定时监控某进程占有内存的大小

    1)添加计划任务 crontab -e会使用某个编辑器打开某个文件,然后在内输入需要执行的计划任务,保存后在/var/spool/cron/crontabs/下会出现以用户名命名的文件 2)计划任务如 ...

  8. linux命令之ll按时间和大小排序显示

    ll不是命令,是ls -l的别名 按大小排序 [root@localhost ~]# ll -Sh 按时间排序 [root@localhost ~]# ll -rt ll -t 是降序, ll -t ...

  9. Linux/Centos查看进程占用内存大小的几种方法总结

    1.命令行输入top回车,然后按下大写M按照memory排序,按下大写P按照CPU排序. 2. ps -ef | grep "进程名"     ps -e -o 'pid,comm ...

随机推荐

  1. package.json和npm install、cnpm install 的問題

    問題:最近使用cnpm安装项目依赖后,运行项目出现样式错乱问题. 描述:最近项目开发,需求参插了很多个版本,所以在前端项目的主干上拉好几套分支代码.拉的分支并不会把node_modules也拉过去,所 ...

  2. week3

    ___________________________________函数________________________ 返回值 = 0 ,返回 0 返回值 = 1, 返回object 返回值> ...

  3. JAVA的入门代码

    public class HelloWord{ public static void main(String[] args){ System.out.println("你好,java&quo ...

  4. 软件151 王楚博 aodp

    一.AOP是OOP的延续,是(Aspect Oriented Programming)的缩写,意思是面向切面编程. AOP(Aspect Orient Programming),作为面向对象编程的一种 ...

  5. java课堂笔记

  6. SSH整合后tomcat启动报错SEVERE: Exception starting filter struts2 java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor

    错误信息:  SEVERE: Exception starting filter struts2 java.lang.NoClassDefFoundError: org/objectweb/asm/C ...

  7. float和position谁好?

    float从字面上的意思就是浮动,float能让元素从文档流中抽出,它并不占文档流的空间,典型的就是图文混排中文字环绕图片的效果了.不过需要注意的是清除浮动是我们可能需要注意的地方.而position ...

  8. java——类、对象、方法

    一.类 1.Java语言把一组对象中相同属性和方法抽象到一个Java源文件就形成了类. 一个java文件可以有多个类,但是每一个类都会生成一个class字节码文件. 如果class 前加public ...

  9. javascript学习笔记_1

    1.JSON的遍历 for(var i in json){  alert(json[i]; }2.arguments 可以理解为是一个数组,并且建有json的部分能力 css(obj,attr,val ...

  10. 【SoftwareTesting】Homework1

    The errors I will mention after are from the project in the last semester. The project is a Java pro ...