2006-02-23

From ScotLUG
Jump to: navigation, search

Notes

Some of these commands require you to use sudo or be root as they can give you information about other peoples processes if you are on a multi-user system

Running Processes

  • ps : list processes started from your current shell
  • ps -fu $user : list all own processes
  • ps auwwx : wide all processes on system (|grep)
  • pstree : tree representation of process parentage
  • top : processes sorted by load
  • pkill : pattern kill
  • killall : kill all based on name - not suitable for Solaris users...
  • ksysguard : graphical process list

/proc

Procfs is a virtual file system in linux mounted in /proc a lot of linux commands (ps, top, pstree, etc.) rely on this filesystem for information. The files and directories of the /proc filesystem are virtual because the data is not actually stored on any sort of permanent storage like a hard disk; instead, the directories, files, and data within them are created dynamically in memory from raw kernel data whenever you attempt to read them.

  • /proc/cpuinfo
  • /proc/ioports
  • /proc/interupts
  • /proc/meminfo
  • /proc/kcore
  • /proc/$pid

Network

  • netstat -a : what is listening on a port
  • netstat -plant : detail processes and which ports they are using
  • tcpdump : network traffic
  • ettercap -c : see who else is on your network
  • traceroute
  • mtr
  • iptables -L -n
  • ifconfig / iwconfig


Disk / File Usage

  • df
  • du : -sh (du -sk|sort -n|tail -5)
  • lsof : open files
  • pv/lv/vg commands for LVM
  • tune2fs -m to modify reserved blocks

Boot

  • dmesg : boot messages and kernel stuff - plug usb drive in to show
  • w : currently logged in users
  • /etc/init.d
  • bum : will allow you to modify boot items from a GUI
  • sysctl -A and /etc/sysctl.conf
  • lsmod/insmod/modprob/rmmod
  • modconf

Hardware Info

  • lspci : pci and agp devices - usefull for trying to get hardware working
  • lsusb : connected usb devices
  • usbview : if you're GUI inclined
  • lshal

Other

  • cron / crontab / anacron
  • uname : various system names and versions
  • uptime : how long it's been alive for