linux ps 按进程消耗内存资源大小排序
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 按进程消耗内存资源大小排序的更多相关文章
- ps - 按进程消耗内存多少排序
https://www.cnblogs.com/JemBai/archive/2011/06/21/2086184.html https://www.cnblogs.com/jiqing9006/p/ ...
- linux ps查看进程命令
linux ps查看进程命令ps命令作用:将某个时间点的程序运作情况撷取下来 实例: [root@linux ~]# ps aux [root@linux ~]# ps -lA [root@linux ...
- linux下对进程按照内存使用情况进行排序
linux下对进程按照内存使用情况进行排序的命令为:ps aux --sort -rss 详细解说参见 http://alvinalexander.com/linux/unix-linux-proce ...
- Linux 查看进程消耗内存情况总结
在Linux中,有很多命令或工具查看内存使用情况,今天我们来看看如何查看进程消耗.占用的内存情况,Linux的内存管理和相关概念要比Windows复杂一些.在此之前,我们需要了解一下Linux系统下面 ...
- linux ps查看进程命令详解
http://linux.net527.cn/Linuxwendang/xitongguanliyuan/39094.htmlLinux操作系统PS命令详细解析 要对系统中进程进行监测控制,用 ps ...
- Linux中查看进程占用内存的情况【转】
转自:http://hutaow.com/blog/2014/08/28/display-process-memory-in-linux/ Linux中查看某个进程占用内存的情况,执行如下命令即可,将 ...
- crond守护进程实现定时监控某进程占有内存的大小
1)添加计划任务 crontab -e会使用某个编辑器打开某个文件,然后在内输入需要执行的计划任务,保存后在/var/spool/cron/crontabs/下会出现以用户名命名的文件 2)计划任务如 ...
- linux命令之ll按时间和大小排序显示
ll不是命令,是ls -l的别名 按大小排序 [root@localhost ~]# ll -Sh 按时间排序 [root@localhost ~]# ll -rt ll -t 是降序, ll -t ...
- Linux/Centos查看进程占用内存大小的几种方法总结
1.命令行输入top回车,然后按下大写M按照memory排序,按下大写P按照CPU排序. 2. ps -ef | grep "进程名" ps -e -o 'pid,comm ...
随机推荐
- 继续mysql8navicat12连接登录的异常
今天登录使用navicat登录连接本地mysql,一直提示Navicat Premium 12连接MySQL数据库出现Authentication plugin 'caching_sha2_passw ...
- Linux下通过vi修改只读文件
打开一个只读文件 $ vi /etc/crontab 此时会进入crontab的编辑界面,通过按键 ESC 可以进入命令模式,按键 I 进入插入模式 但是!如果此时没有权限进行修改的话,虽然可以插入编 ...
- idea中文乱码
- balcanced-binary-tree
题目描述 Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced bi ...
- Django的url控制器
一 url配置 Django 1.11版本 URLConf官方文档 URL配置(URLconf)就像Django 所支撑网站的目录.它的本质是URL与要为该URL调用的视图函数之间的映射表.也就是ur ...
- JS案例四:表格的隔行换色以及高亮显示
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- GC 是什么? 为什么要有GC?
C/C++中由程序员进行对象的回收像学校食堂中由学生收盘子,.Net 中由GC 进行垃圾回收像餐馆中店员 去回收. GC 是垃圾收集器(Garbage Collection).程序员不用担心内存管理, ...
- python-之-深浅拷贝二(元组)
元组比较特殊 1.----元组本身为不可变类型 import copy v1 = (1, 2, 3, 4) v2 = copy.copy(v1) print(id(v1), id(v2)) v3 = ...
- Exploit-Exercises nebule 旅行日志(三)
继续探索之路,经过昨天的题目,忽然有那么点开窍了,今天继续: 看题目,还是用level对应的级别的帐号和密码登录,flag02的程序源码如图上所示,getegid 和 geteuid就不说了,这个程序 ...
- linux 查看并对外开放端口(防火墙拦截处理)
[转]https://blog.csdn.net/qq564425/article/details/80760528 Web应用在Tomcat部署后无法访问,可能是防火墙端口限制导致 查看端口是否可访 ...