This command starts screen with 'htop', 'nethogs' and 'iotop' in split-screen. You have to have these three commands (of course) and specify the interface for nethogs - mine is wlan0, I could have acquired the interface from the default route extending the command but this way is simpler. htop is a wonderful top replacement with many interactive commands and configuration options. nethogs is a program which tells which processes are using the most bandwidth. iotop tells which processes are using the most I/O. The command creates a temporary "screenrc" file which it uses for doing the triple-monitoring. You can see several examples of screenrc files here: http://www.softpanorama.org/Utilities/Screen/screenrc_examples.shtml
top accecpts a comma separated list of PIDs.
pgrep foo
may return several pids for process foobar footy01 etc. like this:
11427
12576
12577
sed puts "-p " in front and we pass a list to top:
top -p 11427 -p 12576 -p 12577
Like command 10870, but no need for sed
running top command in batch mode. it is usefull if you want to redirect the output in a file. Show Sample Output
This version is precise and requires one second to collect statistics. Check sample output for a more generic version and also a remote computer invocation variant. It doesn't work with the busybox version of the 'top' command but can be adjusted Show Sample Output
1. Start a process, such as 'top' command 2. # suspend process {ctrl-Z} 3. # background process bg 4. # list all backgrounded jobs jobs 5. # bring it back to foreground fg
An advanced possibility to count the lines of code like in #8394 Show Sample Output
Show only specific process id's using Top Show Sample Output
You can also use different process using comma: top -p `pgrep pidgin`, `pgrep python` but you have to make sure the process exists or you'll get an error Show Sample Output
Get the current cpu % usage on your system. Show Sample Output
Monitoring system in one line : DISK : disk space MEM: memory ( mem , swap, Total) CPU : all information about cpu activity LOAD : load average Show Sample Output
This command greps the full name of processes. If you have processes with parameters(which you can see by pressing key 'c' in top) - this is the case
Display the top processes sorted by memory usage. This is mostly useful because it's easy to remember and can give me a quick 'top' view of a group of servers when used over pssh. (Though I'd recommend |head -10 to minimize the output). Show Sample Output
I found Flash eating one of my CPUs after resume, the command above will help with that. For optional kicks you can put it into a script in /etc/pm/sleep.d/ (aspect in #swhack wrote this for me)
usage: top -hv | -bcisSHM -d delay -n iterations [-u user | -U user] -p pid [,pid ...] Show Sample Output
Of course, the httpd can be replaced with any other process name Show Sample Output
A simple but effective replacement for ps aux. I used to waste my time running ps over and over; top is the way to go. It also allows complex sorting options. Press q to exit "nicely" (Ctrl + C is always an option, of course). Note that the list updates each second, resorting in the process; if you're trying to grab a specific PID, you might be better off with ps.
htop
Alternatively, htop is available, though it may not come pre-installed. htop is slightly more interactive than top and includes color coding, visuals, and a nice interface for selecting and then killing processes. (Thanks to bwoodacre for this great tool.)
Show Sample Output
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.
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
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: