view the 10 most cpu using processes in browser

while true; do ps aux | sort -rk 3,3 | head -n 11 | cut -c -120 | netcat -l -p 8888 2>&1 >/dev/null; done &
If you want to see your top ten cpu using processes from the browser (e.g. you don't want to ssh into your server all the time for checking system load) you can run this command and browse to the machines ip on port 8888. For example 192.168.0.100:8888
Sample Output
USER       PID %CPU %MEM    VSZ   RSS    TTY   STAT START   TIME COMMAND
dani      1686  8.0  1.4 824304  109608   ?    Sl   08:50   0:18 /opt/google/chrome/chrome --type=renderer --lang=en-US 
dani      4641  5.6  2.8 1105668 214716   ?    SLl  07:45   3:52 /opt/google/chrome/chrome     
dani      4907  3.7  1.4 804528  108432   ?    Sl   07:45   2:34 /usr/bin/python /usr/bin/terminator 
dani      2016  2.5  1.9 1610132 145668   ?    Sl   07:43   1:50 /usr/bin/gnome-shell
dani     29898  1.9  1.4 819684  111108   ?    Sl   08:31   0:26 htop -d 50 
dani      4711  1.4  4.4 939808  337320   ?    Sl   07:45   1:01 /opt/google/chrome/chrome --type=gpu-process
root      1142  1.2  0.2 250188  15876    tty7 Ssl+ 07:43   0:54 /usr/bin/X :0 -background none -verbose -auth /var/run/
dani     25908  1.0  1.2 776468  94180    ?    Sl   08:25   0:18 ssh-agent -s 
dani      4801  0.9  1.5 797872  118132   ?    Sl   07:45   0:38 upstart-event-bridge
dani      4911  0.6  1.1 786736  83248    ?    Sl   07:45   0:28 /usr/lib/ibus/ibus-ui-gtk3

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: