Posted: . At: 9:26 AM. This was 6 years ago. Post ID: 11897
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Get information about a Linux process very easily and quickly.


To get information about a Linux process, use this simple trick, this is to get the processes associated with the current standard input. I.e a terminal.

jason@Yog-Sothoth:~/Documents$ ps -T
  PID  SPID TTY          TIME CMD
 7467  7467 pts/0    00:00:00 bash
 7715  7715 pts/0    00:00:00 top
 7826  7826 pts/0    00:00:00 ps

See which process is using the most memory.

jason@Yog-Sothoth:~/Documents$ ps aux --sort=-%mem | head -n 5
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
jason     6387  9.6  4.5 2689076 555316 ?      Sl   08:26   4:43 /usr/lib/firefox/firefox
jason     7348 14.4  4.2 2541344 517420 ?      Sl   08:54   3:03 /usr/lib/firefox/firefox -contentproc -childID 8 -isForBrowser -intPrefs 5:50|6:-1|18:0|28:1000|34:20|35:5|36:10|45:128|46:10000|51:0|53:400|54:1|55:0|56:0|61:0|62:120|63:120|99:2|100:1|115:5000|125:0|127:0|138:10000|158:24|159:32768|161:0|162:0|170:5|174:1048576|175:100|176:5000|178:600|179:4|180:1|188:20|191:3|204:60000| -boolPrefs 1:0|2:0|4:0|26:1|27:1|30:0|33:1|37:1|38:0|39:0|40:0|43:1|44:1|47:0|48:0|49:0|50:0|52:0|57:1|58:1|59:0|60:1|64:1|65:1|66:0|67:1|68:1|69:0|70:1|73:0|74:0|77:1|78:1|82:1|83:1|84:0|85:0|86:0|88:0|89:0|90:1|91:1|92:1|95:1|96:0|98:0|101:1|102:0|109:0|114:0|117:1|119:1|120:1|122:1|126:0|128:0|130:0|132:1|133:1|139:1|140:0|141:1|143:0|156:0|157:0|160:1|163:1|165:1|167:1|168:0|177:1|182:0|183:1|184:0|185:1|186:0|187:0|189:1|190:1|193:1|196:0|197:0|198:1|199:1|200:0|201:1|202:1|203:1|205:0|206:0|208:0|217:1|218:0|219:0|220:0|221:0| -stringPrefs 3:7;release|97:0;|142:3;1.0|154:332;  ¼½¾ǃː??։֊׃״؉؊٪۔܁܂܃܄ᅟᅠ᜵           ???‐’․‧??????? ‹›⁁⁄⁒ ⅓⅔⅕⅖⅗⅘⅙⅚?⅜⅝⅞⅟∕∶⎮╱⧶⧸⫻⫽⿰⿱⿲⿳⿴⿵⿶⿷⿸⿹⿺⿻ 。〔〕〳゠ㅤ㈝㈞㎮㎯㏆㏟꞉︔︕︿﹝﹞?./。ᅠ???�|155:4;high| -schedulerPrefs 0001,2 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 6387 true tab
jason     7295  9.4  3.3 2498236 411372 ?      Sl   08:52   2:13 /usr/lib/firefox/firefox -contentproc -childID 7 -isForBrowser -intPrefs 5:50|6:-1|18:0|28:1000|34:20|35:5|36:10|45:128|46:10000|51:0|53:400|54:1|55:0|56:0|61:0|62:120|63:120|99:2|100:1|115:5000|125:0|127:0|138:10000|158:24|159:32768|161:0|162:0|170:5|174:1048576|175:100|176:5000|178:600|179:4|180:1|188:20|191:3|204:60000| -boolPrefs 1:0|2:0|4:0|26:1|27:1|30:0|33:1|37:1|38:0|39:0|40:0|43:1|44:1|47:0|48:0|49:0|50:0|52:0|57:1|58:1|59:0|60:1|64:1|65:1|66:0|67:1|68:1|69:0|70:1|73:0|74:0|77:1|78:1|82:1|83:1|84:0|85:0|86:0|88:0|89:0|90:1|91:1|92:1|95:1|96:0|98:0|101:1|102:0|109:0|114:0|117:1|119:1|120:1|122:1|126:0|128:0|130:0|132:1|133:1|139:1|140:0|141:1|143:0|156:0|157:0|160:1|163:1|165:1|167:1|168:0|177:1|182:0|183:1|184:0|185:1|186:0|187:0|189:1|190:1|193:1|196:0|197:0|198:1|199:1|200:0|201:1|202:1|203:1|205:0|206:0|208:0|217:1|218:0|219:0|220:0|221:0| -stringPrefs 3:7;release|97:0;|142:3;1.0|154:332;  ¼½¾ǃː??։֊׃״؉؊٪۔܁܂܃܄ᅟᅠ᜵           ???‐’․‧??????? ‹›⁁⁄⁒ ⅓⅔⅕⅖⅗⅘⅙⅚?⅜⅝⅞⅟∕∶⎮╱⧶⧸⫻⫽⿰⿱⿲⿳⿴⿵⿶⿷⿸⿹⿺⿻ 。〔〕〳゠ㅤ㈝㈞㎮㎯㏆㏟꞉︔︕︿﹝﹞?./。ᅠ???�|155:4;high| -schedulerPrefs 0001,2 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 6387 true tab
jason     7173  2.6  2.3 2218576 282980 ?      Sl   08:47   0:44 /usr/lib/firefox/firefox -contentproc -childID 5 -isForBrowser -intPrefs 5:50|6:-1|18:0|28:1000|34:20|35:5|36:10|45:128|46:10000|51:0|53:400|54:1|55:0|56:0|61:0|62:120|63:120|99:2|100:1|115:5000|125:0|127:0|138:10000|158:24|159:32768|161:0|162:0|170:5|174:1048576|175:100|176:5000|178:600|179:4|180:1|188:20|191:3|204:60000| -boolPrefs 1:0|2:0|4:0|26:1|27:1|30:0|33:1|37:1|38:0|39:0|40:0|43:1|44:1|47:0|48:0|49:0|50:0|52:0|57:1|58:1|59:0|60:1|64:1|65:1|66:0|67:1|68:1|69:0|70:1|73:0|74:0|77:1|78:1|82:1|83:1|84:0|85:0|86:0|88:0|89:0|90:1|91:1|92:1|95:1|96:0|98:0|101:1|102:0|109:0|114:0|117:1|119:1|120:1|122:1|126:0|128:0|130:0|132:1|133:1|139:1|140:0|141:1|143:0|156:0|157:0|160:1|163:1|165:1|167:1|168:0|177:1|182:0|183:1|184:0|185:1|186:0|187:0|189:1|190:1|193:1|196:0|197:0|198:1|199:1|200:0|201:1|202:1|203:1|205:0|206:0|208:0|217:1|218:0|219:0|220:0|221:0| -stringPrefs 3:7;release|97:0;|142:3;1.0|154:332;  ¼½¾ǃː??։֊׃״؉؊٪۔܁܂܃܄ᅟᅠ᜵           ???‐’․‧??????? ‹›⁁⁄⁒ ⅓⅔⅕⅖⅗⅘⅙⅚?⅜⅝⅞⅟∕∶⎮╱⧶⧸⫻⫽⿰⿱⿲⿳⿴⿵⿶⿷⿸⿹⿺⿻ 。〔〕〳゠ㅤ㈝㈞㎮㎯㏆㏟꞉︔︕︿﹝﹞?./。ᅠ???�|155:4;high| -schedulerPrefs 0001,2 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 6387 true tab

Another way to see which processes are using the most memory.

jason@Yog-Sothoth:~/Documents$ ps auxc --sort=-%mem | head -n 20
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
jason     6387  9.9  4.5 2685568 557632 ?      Rl   08:26   4:39 firefox
jason     7348 13.7  4.0 2527592 492176 ?      Sl   08:54   2:36 Web Content
jason     7295 10.2  3.3 2498236 413380 ?      Sl   08:52   2:12 Web Content
jason     7173  2.7  2.3 2218576 284048 ?      Sl   08:47   0:43 Web Content
jason     6918  0.2  1.5 2074560 191488 ?      Sl   08:29   0:07 Web Content
mysql     1214  0.0  1.0 1435588 133436 ?      Ssl  08:22   0:01 mysqld
root      1225  4.3  0.7 360680 88060 tty7     Ssl+ 08:22   2:10 Xorg
jason     3738  0.0  0.6 957640 80136 ?        Sl   08:23   0:01 caja
jason     3781  0.0  0.3 902564 47488 ?        Sl   08:23   0:00 deja-dup-monito
jason     7460  0.3  0.3 634368 45328 ?        Sl   08:56   0:03 mate-terminal
jason     3771  0.0  0.3 885836 44936 ?        Sl   08:23   0:00 goa-daemon
jason     3859  0.0  0.3 1396892 40208 ?       Sl   08:23   0:00 synapse
jason     3726  0.0  0.3 674232 38428 ?        Sl   08:23   0:01 mate-panel
jason     3782  0.0  0.3 688576 37864 ?        Sl   08:23   0:00 nm-applet
jason     3718  0.0  0.3 1616084 36840 ?       Sl   08:23   0:01 mate-settings-d
jason     3742  0.0  0.2 585300 34632 ?        Sl   08:23   0:01 wnck-applet
jason     4033  0.0  0.2 592436 34292 ?        Sl   08:23   0:00 clock-applet
jason     4031  0.0  0.2 578092 33840 ?        Sl   08:23   0:00 mate-indicator-
jason     7248  0.7  0.2 553100 33744 ?        Sl   08:47   0:11 audacious

This is a good way to see what is grabbing all of your ram. The -c parameter to ps, shows only the executable and not the whole command line.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.