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 ...
随机推荐
- Scratch安装使用教程
一.说明 一直听说scratch是一款麻省理工所开发的很好的少儿编程学习工具,一直不是很清楚所谓少儿编程是长什么样所以探究了一下. 二.安装 scratch当前到了3.0版本,3.0版本默认直接是we ...
- shell脚本学习之实例列举
1.用shell写一个从1加到100的程序: 方法一: #!/bin/bashsum=0for i in {1..100}do let sum+=$idone echo $sum 方法二: # ...
- A context-aware personalized travel recommendation system based on geotagged social media data mining
文章简介:利用社交网站Flickr上照片的geotag信息将这些照片聚类发现城市里的旅游景点,通过各照片的拍照时间得到用户访问某景点时的时间上下文和天气上下文(利用时间和public API of W ...
- Servlet(2)
HttpServlet 简介: Servlet 就是一个普通的java类,是运行在web容器上(tomcat)上的一个java类 用来通过Servlet中的代码,接受Http中浏览器的请求信息,以及对 ...
- 三种Webpack打包方式
准备工作mkdir webpack_demo && cd webpack_demo #新建文件夹npm init #创建package.json文件npm install --save ...
- spark提交jar包时出现unsupported major.minor version 52.0错误的解决方案
一.问题: 最近在spark集群上做一个项目,打包提交jar包时,出现了unsupported major.minor version 52.0的报错,而在local模式运行却能正常运行! 二.错误原 ...
- java基础1(二)
Bean的xml配置 1.bean的初始化方式 三种方式: 默认构造器,静态工厂初始化(了解)和实例工厂初始化(了解) 2.springbean的作用域 Bean默认作用域是单实例的 可以设置非单实例 ...
- 最近工作再弄基于bootstrap的定制sass
封装各种组件如 button table 当然..我只才做完两个. 比如table 抽出很多类以后可以配置的值 还有button 目录结构大致是 scss主要css文件 base和components ...
- Map集合练习题
(Map)已知某学校的教学课程内容安排如下: 完成下列要求:1) 使用一个Map,以老师的名字作为键,以老师教授的课程名作为值,表示上述课程安排.2) 增加了一位新老师Allen 教JDBC3) Lu ...
- 分布式大数据系统离线分析技术解决方案(spark2.x)
一.sark2.x新型的架构系统