[clug] Command of the Hour

Ian darkstarsword at gmail.com
Mon Sep 15 18:25:35 GMT 2008


Ok, I want to start a bit of a discussion here - I want everyone to
chime in and tell the list of any random, obscure and useful commands
they know of. Anything you have come across that has helped you in
some way or you thought would be really handy in some situation,
doesn't matter what.


I'll start the ball rolling with several top variants:

atop - I just had an issue where gnome wasn't logging in, but seemed
to be stuck constantly accessing the hard drive. This command saved me
by showing me exactly which program was using the hard drive and a
quick aptitude remove mlocate later my system was working perfectly
again. It monitors CPU, memory, disk and network highlighting any that
are particularly stressed and shows the processes responsible.
Processes are only displayed if they have done something interesting
since the last update. Kernel patches can be taken to enhance the
experience if one is so inclined.

htop - Awesome ncurses graphical top. Looks pretty, coloured, and
simply highlighting a process and pressing 'S' will attach strace to
it to see what that run away process is actually up to. Tag multiple
processes and alter the niceness of them all at once or just kill em'
all. 'T' toggles between process tree view and ordinary top view.

powertop - I'm sure lots of people know about this one by now, but for
anyone who doesn't it can show you various information about what is
chewing up energy in your system and provide some recommendations for
conserving power.

iftop - top for network traffic. Shows the traffic going to and fro on
every individual transfer and totalled down the bottom in ncurses bar
graph style. Amounts are displayed for the last 2, 10 and 40 seconds.
Filters can be applied if one is only interested in a subset of the
total traffic, and it can naturally do hostname lookups and show port
numbers/service names.

ntop - another network top, but this one starts a web server on port
3000 to display it's results with pretty graphs. It has the advantage
that it provides much more detail - it breaks packets down by size,
protocol, etc. It has many displays to analyse the data in varying and
sometimes entertaining ways. Of course, being heavyweight as it is, if
all you need to know is that traffic is flowing from A to B, firing
this one up may be overkill, though it would easily suit as a very
quick and dirty network monitoring solution.


And a few others that I haven't found so useful myself, but someone else might:

itop - top for interrupts. I can imagine it would be useful for
checking if hardware is getting the computers attention when it should
be.

jnettop - this is another network top. I prefer iftop since it gives
me a graphical display (and it's help page is somewhat more detailed
than "I must write something here... :)").

-- 
On the day *I* go to work for Microsoft, faint oinking sounds will be
heard from far overhead, the moon will not merely turn blue but
develop polkadots, and hell will freeze over so solid the brimstone
will go superconductive.
 -- Erik Raymond, 2005
--
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


More information about the linux mailing list