Find out biggest cpu/memory consuming processes with ps command
How to Find out biggest cpu/memory consuming processes with ps command ?
Biggest memory consuming processes
root@kali:~# ps -eo pmem,pcpu,pid,args | tail -n +2 | sort -rnk 1 | head
1.8 0.0 3304 gnome-panel
1.3 0.2 3365 /usr/lib/vmware-tools/sbin64/vmtoolsd -n vmusr --blockFd 3
1.3 0.0 3370 nautilus -n
1.2 0.3 2642 /usr/bin/Xorg :0 -br -verbose -novtswitch -auth /var/run/gdm3/auth-for-Debian-gdm-0vVbZF/database -nolisten tcp vt7
1.0 0.1 3468 gnome-terminal
0.9 0.0 3377 nm-applet
0.8 0.0 3371 gnome-screensaver
0.8 0.0 3357 gnome-sound-applet
0.8 0.0 3267 /usr/lib/gnome-settings-daemon/gnome-settings-daemon
0.7 0.0 3458 /usr/lib/gnome-online-accounts/goa-daemon
Biggest cpu consuming processes
root@kali:~# ps -eo pmem,pcpu,pid,args | tail -n +2 | sort -rnk 2 | head
0.1 26.4 5845 find / -name *fg*
1.8 0.0 3304 gnome-panel
1.3 0.3 3365 /usr/lib/vmware-tools/sbin64/vmtoolsd -n vmusr --blockFd 3
1.3 0.3 2642 /usr/bin/Xorg :0 -br -verbose -novtswitch -auth /var/run/gdm3/auth-for-Debian-gdm-0vVbZF/database -nolisten tcp vt7
1.3 0.0 3370 nautilus -n
0.9 0.1 3468 gnome-terminal
0.9 0.0 3377 nm-applet
0.8 0.0 3371 gnome-screensaver
0.8 0.0 3357 gnome-sound-applet
0.8 0.0 3267 /usr/lib/gnome-settings-daemon/gnome-settings-daemon
Explanations
- ps Report a snapshot of the current processes
- -e Select all processes
- o Specify user-defined format
- pmem,pcpu,pid,args user-defined format: memory,cpu, pid number and command
- tail -n +2 Output lines starting to the second line (to avoid column names such %MEM, etc …)
- sort -rnk 1 reverse (r), numeric sort (n) by column 1 (memory)
- sort -rnk 2 reverse (r), numeric sort (n) by column 2 (cpu)
- head output the 10 first lines
Enjoy !!!
If you found this post or this website helpful and would like to support our work, please consider making a donation. Thank you!
Help UsArticles in the same category
- Time a task: time
- SVN -- How to ignore file or directory in subversion?
- SVN -- Branch, Branching subversion howto
- Speedup GNU make build and compilation process
- phpMyAdmin: Search and Replace in MySQL database
- Linux How to delete or remove printer from command line
- Linux How to connect to Windows with remote desktop RDP in CentOS 7 / RedHat 7
- Intel compilation for MIC architecture KNL Knights Landing
- How to setup SSH timeout in shell script ?
- How to make a denial of a service with fork functions in BASH ?
- How to encrypt/decrypt a file or directory in Linux?
- How to diff remote files using ssh ?
- How to Convert Text File From ISO-8859-15 to UTF-8 Encoding
- How to change the MAC address on Linux
- Got permission denied while trying to connect to the Docker daemon socket
- GNU compilation for MIC architecture KNL Knights Landing
- Generating a self-signed certificate using OpenSSL with Linux CentOs/RedHat for Apache/httpd
- Find out biggest cpu/memory consuming processes with ps command
- Find list of options that python was compiled with
- Download music and videos .mp3, .wma, .avi, .mpg , divx with google
- Crontab : Scheduling Tasks
- Comment changer son adresse MAC sous Linux
- Check/find version of numpy i'm using
- Archiving and compressing data files tar
- Linux - Tip of the day