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 ...
随机推荐
- python编程学习--Pygame - Python游戏编程入门(0)---转载
原文地址:https://www.cnblogs.com/wuzhanpeng/p/4261015.html 引言 博客刚开,想把最近学习的东西记录下来,算是一种笔记.最近打算开始学习Python,因 ...
- 遇到的有关iframe的滚动条问题
今天才发现一个简单有趣的问题,有关iframe的: <div style="height: 800px;overflow: auto;"> <iframe src ...
- js 数据处理
开发过程中经常遇到 1. json数据结构(对象和数组) json对象:var obj = {"name":"xiao","age":12} ...
- MySQL · 性能优化· 5.7.6 InnoDB page flush 优化
在这篇文中,我们已经详细介绍了Oracle MySQL以及社区分支最新的对InnoDB page flush的优化.在最近release的5.7.6版本中又有了进一步的改进.主要包括以下几点修改 修改 ...
- sql排列组合
一个表中4条记录,如何查询所有可能组成的结果. 例如: 1 2 3 4 四条记录,最后组成(12),(13),(14),(23),(24),(34) 最后sql如下: SELECT a.name ...
- Windows Message ID 常量列表大全
namespace WindowsUtilities{ public enum WindowsMessages : int { WM_NULL = 0x0000, ...
- 外贸站全球网速测试+免费CDN使用教程
关于外贸网站速度测试,以前一全老师(www.yiquanseo.com)也讲到过,但是在那篇文章中推荐给大家的两个测试网站(https://developers.google.com/speed/pa ...
- 其他知识点,API
日期和Math 获取2017-06-10格式的日期 Date.now() //当前时间毫秒数 var dt=new Date() dt.getTime() //毫秒数 dt.getFullYear() ...
- Python之元组方法
def count(self, value): # 计算元素出现的个数 """ T.count(value) -> integer -- return number ...
- docker学习构建镜像---第三章节
一.docker镜像使用 运行docker容器时,使用的镜像如果在本地不存在,docker会自动从docker镜像仓库中下载,默认是从docker hub公共镜像源下载 在这里,我们需要了解:管理和使 ...