Basic Monitoring and Debugging Linux commands

Basic Monitoring and Debugging Linux commands

Here is a list of the most commanly used Linux commands for performance monitoring and debugging that will be helpful when you are working on Linux environment. This list is not comprehensive or authoritative by any means.

However, this list has enough commands for you to play around and pick the ones that are suitable for your specific debugging and monitoring scenario.

  • top: show linux tasks using most cpu.
  • ps -eafw: show Linux tasks.
  • ps -e -o pid, args –forest: Show Linux tasks in hierarchical mode.
  • pstree: show a process system tree.
  • kill -9 ID_Processo: force close a process and kill it.
  • kill -1 Process_ID: force a process to reload the configuration.
  • lsof -p $$: show a list of files opened by processes.
  • lsof / home / user1: shows a list of files open in a given path of the system.
  • strace -c ls> / dev / null: show the system calls made and received by a process.
  • strace -f -e open ls> / dev / null: show library calls.
  • watch -n1 ‘cat / proc / interrupts’: show interrupts in real time.
  • last reboot: show reboot history.
  • lsmod: show the loaded kernel.
  • free -m: shows RAM status in megabytes.
  • smartctl -A / dev / hda: monitor the reliability of a hard disk through SMART.
  • smartctl -i / dev / hda: check if SMART is enabled on a hard disk.
  • tail / var / log / dmesg: show events inherent to the kernel loading process.
  • tail / var / log / messages: show system events.
whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.