检查节点上进程的内存和CPU消耗。

检查节点上进程的内存和CPU消耗。
.

0

linux命令:ps -eo pcpu,pmem,cmd | grep Service| grep -v grep| sort -k 1 -nr | head -5 -5 head | -nr 1 -k sort grep| -v grep Service| grep | pcpu,pmem,cmd -eo ps ps -eo pcpu,pmem,cmd | grep Service| grep -v grep| sort -k 1 -nr | head -5rootopen.com
linux命令:ps -eo pcpu,pmem,cmd | grep Service| grep -v grep| sort -k 1 -nr | head -5 -5 head | -nr 1 -k sort grep| -v grep Service| grep | pcpu,pmem,cmd -eo ps ps -eo pcpu,pmem,cmd | grep Service| grep -v grep| sort -k 1 -nr | head -5rootopen.com
pxkt 2018-01-26 08:59:48
输出
linux命令:ps 详解

评论

相关推荐

ps2pdf 是一个Ghostscript附带的脚本 - 尽管名称,它可以接受PDF文件作为输入,而不仅仅是postscript文件

linux命令:ps2pdf -dFirstPage=3 -dLastPage=10 input.pdf output.pdf output.pdf input.pdf -dLastPage=10 -dFirstPage=3 ps2pdf ps2pdf -dFirstPage=3 -dLastPage=10 input.pdf output.pdfrootopen.com
linux命令:ps2pdf -dFirstPage=3 -dLastPage=10 input.pdf output.pdf output.pdf input.pdf -dLastPage=10 -dFirstPage=3 ps2pdf ps2pdf -dFirstPage=3 -dLastPage=10 input.pdf output.pdfrootopen.com
.

关于前10个进程的简短列表,按CPU使用情况排序

linux命令:ps aux | sort -rk 3,3 | head -n 10 10 -n head | 3,3 -rk sort | aux ps ps aux | sort -rk 3,3 | head -n 10rootopen.com
linux命令:ps aux | sort -rk 3,3 | head -n 10 10 -n head | 3,3 -rk sort | aux ps ps aux | sort -rk 3,3 | head -n 10rootopen.com
.

忽略“sshd”服务器,因为您不应该杀死ssh服务器进程

linux命令:ps aux | grep ssh | grep -v grep | grep -v sshd | awk {'print $2'} | xargs -r kill -9 -9 kill -r xargs | $2'} {'print awk | sshd -v grep | grep -v grep | ssh grep | aux ps ps aux | grep ssh | grep -v grep | grep -v sshd | awk {'print $2'} | xargs -r kill -9rootopen.com
linux命令:ps aux | grep ssh | grep -v grep | grep -v sshd | awk {'print $2'} | xargs -r kill -9 -9 kill -r xargs | $2'} {'print awk | sshd -v grep | grep -v grep | ssh grep | aux ps ps aux | grep ssh | grep -v grep | grep -v sshd | awk {'print $2'} | xargs -r kill -9rootopen.com
.

pstree将运行进程显示为树,如果省略PID,则以PID或init为根

linux命令:pstree pstree pstreerootopen.com
linux命令:pstree pstree pstreerootopen.com
.

ps显示有关在系统上运行的活动进程的有用信息 下面的示例显示了最高内存和CPU使用率的最高运行进程

linux命令:ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head head | --sort=-%mem pid,ppid,cmd,%mem,%cpu -eo ps ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | headrootopen.com
linux命令:ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head head | --sort=-%mem pid,ppid,cmd,%mem,%cpu -eo ps ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | headrootopen.com
.

head命令用于显示指定文件的第一行(默认为10行)或stdin到屏幕

linux命令:ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head head | --sort=-%mem pid,ppid,cmd,%mem,%cpu -eo ps ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head rootopen.com
linux命令:ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head head | --sort=-%mem pid,ppid,cmd,%mem,%cpu -eo ps ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head rootopen.com
.

linux命令:ps -ef | less less | -ef ps ps -ef | lessrootopen.com
linux命令:ps -ef | less less | -ef ps ps -ef | lessrootopen.com
.

ps返回所有正在运行的进程,然后按照数字顺序按第4个字段排序,前10位发送到STDOUT。

linux命令:ps aux | sort -nk +4 | tail tail | +4 -nk sort | aux ps ps aux | sort -nk +4 | tailrootopen.com
linux命令:ps aux | sort -nk +4 | tail tail | +4 -nk sort | aux ps ps aux | sort -nk +4 | tailrootopen.com
.

linux命令:ps -auwx|egrep hunger|grep -v grep| awk '{print "kill -9",$1}' > ~/fu.bar ~/fu.bar > -9",$1}' "kill '{print awk grep| -v hunger|grep -auwx|egrep ps ps -auwx|egrep hunger|grep -v grep| awk '{print "kill -9",$1}' > ~/fu.barrootopen.com
linux命令:ps -auwx|egrep hunger|grep -v grep| awk '{print "kill -9",$1}' > ~/fu.bar ~/fu.bar > -9",$1}' "kill '{print awk grep| -v hunger|grep -auwx|egrep ps ps -auwx|egrep hunger|grep -v grep| awk '{print "kill -9",$1}' > ~/fu.barrootopen.com
.

用foo杀死所有进程。与pkill类似,但更完整,也适用于没有pkill命令的情况。几乎在所有我尝试过的Linux / Unix平台上都可以使用。

linux命令:ps -ef | grep [f]oo | awk '{print $2}' | xargs kill -9 -9 kill xargs | $2}' '{print awk | [f]oo grep | -ef ps ps -ef | grep [f]oo | awk '{print $2}' | xargs kill -9rootopen.com
linux命令:ps -ef | grep [f]oo | awk '{print $2}' | xargs kill -9 -9 kill xargs | $2}' '{print awk | [f]oo grep | -ef ps ps -ef | grep [f]oo | awk '{print $2}' | xargs kill -9rootopen.com
.

linux命令:ps awwwux | grep httpd | grep -v grep | awk '{mem = $6; tot = $6 + tot; total++} END{printf("Total procs: %d\nAvg Size: %d KB\nTotal Mem Used: %f GB\n", total, mem / total, tot / 1024 / 1024)}' 1024)}' / 1024 / tot total, / mem total, GB\n", %f Used: Mem KB\nTotal %d Size: %d\nAvg procs: END{printf("Total total++} tot; + $6 = tot $6; = '{mem awk | grep -v grep | httpd grep | awwwux ps ps awwwux | grep httpd | grep -v grep | awk '{mem = $6; tot = $6 + tot; total++} END{printf("Total procs: %d\nAvg Size: %d KB\nTotal Mem Used: %f GB\n", total, mem / total, tot / 1024 / 1024)}'rootopen.com
linux命令:ps awwwux | grep httpd | grep -v grep | awk '{mem = $6; tot = $6 + tot; total++} END{printf("Total procs: %d\nAvg Size: %d KB\nTotal Mem Used: %f GB\n", total, mem / total, tot / 1024 / 1024)}' 1024)}' / 1024 / tot total, / mem total, GB\n", %f Used: Mem KB\nTotal %d Size: %d\nAvg procs: END{printf("Total total++} tot; + $6 = tot $6; = '{mem awk | grep -v grep | httpd grep | awwwux ps ps awwwux | grep httpd | grep -v grep | awk '{mem = $6; tot = $6 + tot; total++} END{printf("Total procs: %d\nAvg Size: %d KB\nTotal Mem Used: %f GB\n", total, mem / total, tot / 1024 / 1024)}'rootopen.com
.

我喜欢将它作为我的.bashrc文件中的别名,例如:别名psme ='ps -ef | grep $ USER'

linux命令:ps -ef | grep $USER $USER grep | -ef ps ps -ef | grep $USERrootopen.com
linux命令:ps -ef | grep $USER $USER grep | -ef ps ps -ef | grep $USERrootopen.com
.

linux命令:ps -e | grep SearchStringHere SearchStringHere grep | -e ps ps -e | grep SearchStringHererootopen.com
linux命令:ps -e | grep SearchStringHere SearchStringHere grep | -e ps ps -e | grep SearchStringHererootopen.com
.

可能以前发布过,我一直使用它来查找和杀死“APP”的进程。只需将“APP”替换为您要杀死的进程的名称即可。

linux命令:ps -ef | grep APP | awk '/grep/!{print$2}' | xargs -i kill {} {} kill -i xargs | '/grep/!{print$2}' awk | APP grep | -ef ps ps -ef | grep APP | awk '/grep/!{print$2}' | xargs -i kill {}rootopen.com
linux命令:ps -ef | grep APP | awk '/grep/!{print$2}' | xargs -i kill {} {} kill -i xargs | '/grep/!{print$2}' awk | APP grep | -ef ps ps -ef | grep APP | awk '/grep/!{print$2}' | xargs -i kill {}rootopen.com
.

在ps(linux)的输出中显示父对子进程的树视图。类似的输出可以通过pstree(也是linux)或ptree(Solaris)来实现。

linux命令:ps auxf auxf ps ps auxfrootopen.com
linux命令:ps auxf auxf ps ps auxfrootopen.com
.

用方括号括起你的第一个字母,你不会产生grep -v的第二个实例。你也可以使用这样的别名(尽管使用sed):别名psgrep ='ps aux | grep $(echo $ 1 | sed“s / ^ \(。\)/ [\ 1] / g”)'

linux命令:ps aux | grep [h]ttpd [h]ttpd grep | aux ps ps aux | grep [h]ttpdrootopen.com
linux命令:ps aux | grep [h]ttpd [h]ttpd grep | aux ps ps aux | grep [h]ttpdrootopen.com
.

8〜osstat,$ 2〜pid,$ 11〜cmd

linux命令:ps aux | awk '{ print $8 " " $2 " " $11}' | grep -w Z Z -w grep | $11}' " " $2 " " $8 print '{ awk | aux ps ps aux | awk '{ print $8 " " $2 " " $11}' | grep -w Zrootopen.com
linux命令:ps aux | awk '{ print $8 " " $2 " " $11}' | grep -w Z Z -w grep | $11}' " " $2 " " $8 print '{ awk | aux ps ps aux | awk '{ print $8 " " $2 " " $11}' | grep -w Zrootopen.com
.

linux命令:ps awwux|awk '{print $1}'|sort|uniq $1}'|sort|uniq '{print awwux|awk ps ps awwux|awk '{print $1}'|sort|uniqrootopen.com
linux命令:ps awwux|awk '{print $1}'|sort|uniq $1}'|sort|uniq '{print awwux|awk ps ps awwux|awk '{print $1}'|sort|uniqrootopen.com
.

linux命令:psnup -4 -pa4 -Pa4 file.ps file2.ps file2.ps file.ps -Pa4 -pa4 -4 psnup psnup -4 -pa4 -Pa4 file.ps file2.psrootopen.com
linux命令:psnup -4 -pa4 -Pa4 file.ps file2.ps file2.ps file.ps -Pa4 -pa4 -4 psnup psnup -4 -pa4 -Pa4 file.ps file2.psrootopen.com
.

linux命令:psnup -2 file.ps | lpr lpr | file.ps -2 psnup psnup -2 file.ps | lprrootopen.com
linux命令:psnup -2 file.ps | lpr lpr | file.ps -2 psnup psnup -2 file.ps | lprrootopen.com
.
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

推荐
    热门命令