LWN.net Logo

CLI Magic: Linux troubleshooting tools 101 (Linux.com)

CLI Magic: Linux troubleshooting tools 101 (Linux.com)

Posted Feb 19, 2007 18:38 UTC (Mon) by aisotton (subscriber, #39278)
Parent article: CLI Magic: Linux troubleshooting tools 101 (Linux.com)

Nice article, but I really hoped for more. I have to admit that I didn't know about ltrace though.

A few tools which are missing from the list:

  • netstat - find out what your system's network stack is doing.
  • nc - check whether services are running, transfer files, run commands, transfer files and soooo much more.
  • du - see how big files/directories are.
  • vmstat - information about memory. You can get the important parts of the information from top too, but when a system is heavily overloaded vmstat just runs faster.
  • ps, kill, killall - classics which needs no description.

Does anybody else know about more useful tools for quick troubleshooting?


(Log in to post comments)

CLI Magic: Linux troubleshooting tools 101 (Linux.com)

Posted Feb 19, 2007 19:39 UTC (Mon) by Ross (subscriber, #4065) [Link]

For memory-leak problems you might also use:
ipcs # shared memory or other IPC leaks
xrestop # X resource leaks
memstat # memory usage by process and file

Lots of "development" tools can also be useful for finding crashes or
memory leaks:
gdb
valgrind

glibc also has some environmental variables to help find (or work around) buggy usage of malloc/free:
MALLOC_CHECK_=0 # heap corruption ignored
MALLOC_CHECK_=1 # heap corruption printed to stderr
MALLOC_CHECK_=2 # heap corruption causes abort()

Also, just doing ls -l in /proc/<pid>/fd can be enlightening when trying
to figure out what a program is doing.

-Ross

netcat

Posted Feb 20, 2007 4:02 UTC (Tue) by ldo (subscriber, #40946) [Link]

Just a note that nc might be called netcat, depending on your distro. On my Gentoo system it's nc, on SuSE it's netcat.

CLI Magic: Linux troubleshooting tools 101 (Linux.com)

Posted Feb 21, 2007 13:35 UTC (Wed) by k8to (subscriber, #15413) [Link]

Unfortunately ltrace doesn't have nearly as much smarts as strace in decoding arguments. In fairness the problem space is HUGE by comparison, so I'm not sure you can realistically expect it, but I find I often can't really make heads or tails of an ltrace, while an strace is often quite straighforward.

The issue being all the interfaces that take pointers. strace typically shows you the struct entries, ltrace typically shows you the location and that's it.

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.