- /proc/config[.gz]: This stores the compile time configuration for the currently running kernel. In 2.6 it is gzipped in 2.4 it isn't. It is in the same format as /usr/src/linux/.config.
- Where to get: This is a non-standard kernel patch. It is part of the standard gentoo-sources kernel but I don't know about other distros.
- /proc/cpuinfo: This stores info abouth the CPUs in the system. Here is a single and dual CPU example:
dementia# cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 10
model name : AMD Athlon(tm) XP 2800+
stepping : 0
cpu MHz : 2083.203
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow
bogomips : 4104.19
insomnia# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 6
model name : Celeron (Mendocino)
stepping : 5
cpu MHz : 501.163
cache size : 128 KB
physical id : 0
siblings : 1
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr
bogomips : 987.13
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 6
model name : Celeron (Mendocino)
stepping : 5
cpu MHz : 501.163
cache size : 128 KB
physical id : 0
siblings : 1
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr
bogomips : 999.42
- Where to get: Comes with kernel
- /proc/dma: This simply lists the DMA channels in use by the kernel drivers:
insomnia# cat /proc/dma
4: cascade
5: GUS - 1
7: GUS - 2
- Where to get: Comes with kernel
- /proc/interrupts: This lists the IRQs in use by kernel drivers:
asylum# cat /proc/interrupts
CPU0
0: 332015004 XT-PIC timer
1: 163 XT-PIC i8042
2: 0 XT-PIC cascade
7: 5135 XT-PIC parport0
8: 2 XT-PIC rtc
10: 18747006 XT-PIC eth1
11: 27560016 XT-PIC aic7xxx, eth0
12: 123 XT-PIC i8042
15: 12 XT-PIC ide1
NMI: 0
LOC: 0
ERR: 0
MIS: 0
- Where to get: Comes with kernel
- /proc/iomem: This lists the IO memory ranges:
asylum# cat /proc/iomem
00000000-0009fbff : System RAM
0009fc00-0009ffff : reserved
000a0000-000bffff : Video RAM area
000c0000-000cafff : Video ROM
000cc000-000d1fff : Adapter ROM
000f0000-000fffff : System ROM
00100000-2ffeffff : System RAM
00100000-003c7b3e : Kernel code
003c7b3f-0047e33f : Kernel data
2fff0000-2fff2fff : ACPI Non-volatile Storage
2fff3000-2fffffff : ACPI Tables
d0000000-d3ffffff : 0000:00:00.0
d4000000-d7ffffff : PCI Bus #01
d4000000-d7ffffff : 0000:01:00.0
d4000000-d7ffffff : aty128fb FB
d8000000-d9ffffff : PCI Bus #01
d9000000-d9003fff : 0000:01:00.0
d9000000-d9003fff : aty128fb MMIO
db000000-dcffffff : PCI Bus #02
dc000000-dc0fffff : 0000:02:04.0
dc000000-dc0fffff : e100
dc100000-dc1fffff : 0000:02:05.0
dc100000-dc1fffff : e100
dd000000-dd0fffff : PCI Bus #02
dd000000-dd000fff : 0000:02:04.0
dd000000-dd000fff : e100
dd001000-dd001fff : 0000:02:05.0
dd001000-dd001fff : e100
dd100000-dd100fff : 0000:00:08.0
dd100000-dd100fff : aic7xxx
ffff0000-ffffffff : reserved
- Where to get: Comes with kernel
- /proc/ioports: This lists the older style IO interface addresses:
asylum# cat /proc/ioports
0000-001f : dma1
0020-0021 : pic1
0040-0043 : timer0
0050-0053 : timer1
0060-006f : keyboard
0070-0077 : rtc
0080-008f : dma page reg
00a0-00a1 : pic2
00c0-00df : dma2
00f0-00ff : fpu
0170-0177 : ide1
02f8-02ff : serial
0376-0376 : ide1
0378-037a : parport0
03c0-03df : vga+
03f8-03ff : serial
0778-077a : parport0
0cf8-0cff : PCI conf1
5000-500f : 0000:00:07.4
6000-607f : 0000:00:07.4
9000-9fff : PCI Bus #01
9000-90ff : 0000:01:00.0
a000-afff : PCI Bus #02
a000-a01f : 0000:02:04.0
a000-a01f : e100
a400-a41f : 0000:02:05.0
a400-a41f : e100
b800-b8ff : 0000:00:08.0
bc00-bc0f : 0000:00:07.1
bc00-bc07 : ide0
bc08-bc0f : ide1
c000-c03f : 0000:00:0d.0
- Where to get: Comes with kernel
- /proc/meminfo: This gives current usage statistics about how the system is using its memory and swap:
asylum# cat /proc/meminfo
MemTotal: 775204 kB
MemFree: 41892 kB
Buffers: 102876 kB
Cached: 507196 kB
SwapCached: 0 kB
Active: 225856 kB
Inactive: 450148 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 775204 kB
LowFree: 41892 kB
SwapTotal: 1068280 kB
SwapFree: 1068280 kB
Dirty: 24 kB
Writeback: 0 kB
Mapped: 81388 kB
Slab: 46112 kB
CommitLimit: 1455880 kB
Committed_AS: 162736 kB
PageTables: 2836 kB
VmallocTotal: 253896 kB
VmallocUsed: 22096 kB
VmallocChunk: 231788 kB
- Where to get: Comes with kernel
- free: This command gives a quick summary of memory and swap usage statistics:
asylum# free
total used free shared buffers cached
Mem: 775204 737180 38024 0 103628 508764
-/+ buffers/cache: 124788 650416
Swap: 1068280 0 1068280
dementia# free
total used free shared buffers cached
Mem: 1035316 823772 211544 0 12744 338436
-/+ buffers/cache: 472592 562724
Swap: 2104504 131764 1972740
- Where to get: Part of procps which should come with all distros.
- /proc/swaps: This is a list of all the devices currently used as swap as well as how much of each is being used:
insomnia# cat /proc/swaps
Filename Type Size Used Priority
/dev/ide/host4/bus0/target0/lun0/part7 partition 658624 0 5
/dev/ide/host5/bus0/target0/lun0/part2 partition 506008 4 5
/dev/ide/host2/bus0/target0/lun0/part2 partition 208804 4 5
- Where to get: Comes with kernel.
- /proc/pci: This lists the PCI devices and related info in the system:
asylum# cat /proc/pci
PCI devices found:
Bus 0, device 0, function 0:
Host bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133] (rev 3).
Master Capable. Latency=8.
Prefetchable 32 bit memory at 0xd0000000 [0xd3ffffff].
Bus 0, device 1, function 0:
PCI bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133 AGP] (rev 0).
Master Capable. No bursts. Min Gnt=12.
Bus 0, device 7, function 0:
ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South] (rev 64).
Bus 0, device 7, function 1:
IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 6).
Master Capable. Latency=32.
I/O at 0xbc00 [0xbc0f].
Bus 0, device 7, function 4:
Bridge: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI] (rev 64).
IRQ 11.
Bus 0, device 8, function 0:
SCSI storage controller: Adaptec AHA-2940U/UW/D / AIC-7881U (rev 1).
IRQ 11.
Master Capable. Latency=32. Min Gnt=8.Max Lat=8.
I/O at 0xb800 [0xb8ff].
Non-prefetchable 32 bit memory at 0xdd100000 [0xdd100fff].
Bus 0, device 11, function 0:
PCI bridge: Digital Equipment Corporation DECchip 21152 (rev 3).
Master Capable. Latency=32. Min Gnt=6.
Bus 0, device 13, function 0:
Communication controller: Comtrol Corporation RocketPort 8 port w/octa cable (rev 4).
IRQ 9.
I/O at 0xc000 [0xc03f].
Bus 1, device 0, function 0:
VGA compatible controller: ATI Technologies Inc Rage 128 PF/PRO AGP 4x TMDS (rev 0).
IRQ 5.
Master Capable. Latency=32. Min Gnt=8.
Prefetchable 32 bit memory at 0xd4000000 [0xd7ffffff].
I/O at 0x9000 [0x90ff].
Non-prefetchable 32 bit memory at 0xd9000000 [0xd9003fff].
Bus 2, device 4, function 0:
Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 5).
IRQ 11.
Master Capable. Latency=32. Min Gnt=8.Max Lat=56.
Prefetchable 32 bit memory at 0xdd000000 [0xdd000fff].
I/O at 0xa000 [0xa01f].
Non-prefetchable 32 bit memory at 0xdc000000 [0xdc0fffff].
Bus 2, device 5, function 0:
Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (#2) (rev 5).
IRQ 10.
Master Capable. Latency=32. Min Gnt=8.Max Lat=56.
Prefetchable 32 bit memory at 0xdd001000 [0xdd001fff].
I/O at 0xa400 [0xa41f].
Non-prefetchable 32 bit memory at 0xdc100000 [0xdc1fffff].
- Where to get: Comes with kernel. As of 2.6 this must be enabled with the "legacy /proc/pci support" in the kernel config.
- lspci: This gives the same info as /proc/pci but in a much more readable format:
asylum# lspci
0000:00:00.0 Host bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133] (rev 03)
0000:00:01.0 PCI bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133 AGP]
0000:00:07.0 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South] (rev 40)
0000:00:07.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)
0000:00:07.4 Bridge: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI] (rev 40)
0000:00:08.0 SCSI storage controller: Adaptec AHA-2940U/UW/D / AIC-7881U (rev 01)
0000:00:0b.0 PCI bridge: Digital Equipment Corporation DECchip 21152 (rev 03)
0000:00:0d.0 Communication controller: Comtrol Corporation RocketPort 8 port w/octa cable (rev 04)
0000:01:00.0 VGA compatible controller: ATI Technologies Inc Rage 128 PF/PRO AGP 4x TMDS
0000:02:04.0 Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 05)
0000:02:05.0 Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 05)
dementia# lspci
0000:00:00.0 Host bridge: VIA Technologies, Inc. VT8377 [KT400/KT600 AGP] Host Bridge
0000:00:01.0 PCI bridge: VIA Technologies, Inc. VT8235 PCI Bridge
0000:00:08.0 SCSI storage controller: Adaptec AHA-2940U/UW/D / AIC-7881U (rev 01)
0000:00:09.0 Multimedia audio controller: Cirrus Logic CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator] (rev 01)
0000:00:0a.0 RAID bus controller: 3ware Inc 3ware Inc 3ware 5xxx/6xxx-series PATA-RAID (rev 12)
0000:00:0c.0 PCI bridge: Digital Equipment Corporation DECchip 21152 (rev 03)
0000:00:0e.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10)
0000:00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)
0000:00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)
0000:00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)
0000:00:10.3 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 82)
0000:00:11.0 ISA bridge: VIA Technologies, Inc. VT8235 ISA Bridge
0000:00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)
0000:00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 74)
0000:01:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G400 AGP (rev 85)
0000:02:04.0 Ethernet controller: Digital Equipment Corporation DECchip 21140 [FasterNet] (rev 22)
0000:02:05.0 Ethernet controller: Digital Equipment Corporation DECchip 21140 [FasterNet] (rev 22)
- dmesg: This displays the kernel debugging messages that are stored in a small (usually 14KB) buffer. It is usually used to show the kernel bootup messages however those can be quickly pushed out of the buffer by other logged data.
- Where to get: Part of util-linux which should come with all distros.
- fuser: This can tell you what is using a particular filesystem. It is often used to answer the "Why can't I unmount this?" question:
asylum# fuser -vm /home/asylum
USER PID ACCESS COMMAND
/home/asylum kmk 1914 ..c.. tcsh
kmk 1915 ..c.. tcsh
kmk 1916 ..c.. tcsh
kmk 1917 ..c.. tcsh
root 2047 ..c.. su
root 2050 ..c.. tcsh
root 2068 ..c.. xtail
root 2073 ..c.. su
root 14815 f.c.. smbd
kmk 25986 ..c.. tcsh
kmk 25987 ..c.. tcsh
kmk 25988 ..c.. tcsh
kmk 25989 ..c.. tcsh
kmk 26142 f.c.. vim
root kernel mount /home/asylum/kmk/graphics/movies/Music_Videos
root kernel mount /home/asylum/kmk/mail/backup_inbox.old
- Where to get: Part of the psmisc package which should come with all distros.
- lsof: LiSts Open Files. Actually it lists file descriptors which include TCP and UDP ports. Very usefull in determining what is using what. This also counts as a security tool. short demo here
- top: Displays a running summary of the current system statistics and which processes are using the most resources. Short demo here
- Where to get: another part of procps.
- htop: Same as top but it looks better and has easier keys.
- atop: Much like top except that it uses process accounting data instead of snapshots.Very short demo here
- mbmon: Shows hardware sensor data from the motherboard:
asylum# mbmon -A -c1
Temp.= 61.8, 33.4, 23.3; Rot.= 3479, 0, 0
Vcore = 1.82, 3.10; Volt. = 3.29, 4.83, 11.77, 0.00, 0.00
dementia# mbmon -A -c1
Temp.= 40.0, 27.0, 50.6; Rot.= 2556, 3835, 0
Vcore = 1.65, 3.39; Volt. = 2.99, 5.19, 9.55, -5.17, -2.72
- mount: Lists all mounted filesystems with mount options:
asylum# mount
/dev/sda1 on / type reiserfs (rw,noatime,notail)
none on /dev type devfs (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,mode=0622)
/dev/sda6 on /var type reiserfs (rw,nodev,noatime,notail)
/dev/sda7 on /usr type reiserfs (rw,nodev,noatime,notail)
/dev/sda9 on /usr/portage type reiserfs (rw,nosuid,nodev,noatime,notail)
/dev/sda8 on /var/tmp type reiserfs (rw,nosuid,nodev,noatime,notail)
/dev/md1 on /home/asylum type reiserfs (rw,nosuid,nodev,noatime)
/dev/sdf1 on /mp3 type reiserfs (rw,nosuid,nodev,noatime)
/dev/md0 on /home/asylum/kmk/graphics/movies/Music_Videos type xfs (rw,noexec,nodev,noatime,nodiratime)
tmpfs on /dev/shm type tmpfs (rw,noexec,nosuid,nodev,noatime,size=8M)
tmpfs on /tmp type tmpfs (rw,noexec,nosuid,nodev,noatime,size=800M)
/home/asylum/kmk/mail/.backup_inbox.old.squashfs on /home/asylum/kmk/mail/backup_inbox.old type squashfs (ro,noexec,nosuid,nodev,loop=/dev/loop0)
nfsd on /proc/fs/nfs type nfsd (rw)
hellmouth:/home/hellmouth on /home/hellmouth type nfs (rw,nosuid,nodev,udp,hard,intr,rsize=8192,wsize=8192,bg,addr=192.168.100.1)
- Where to get: another part of util-linux.
- iostat: Gives some per-disk IO stats:
asylum# iostat
Linux 2.6.11-gentoo-r4 (asylum) 03/29/05
avg-cpu: %user %nice %sys %iowait %idle
3.10 0.49 2.59 1.47 92.35
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda 3.69 151.78 23.94 50570948 7975504
sdb 1.45 61.17 64.91 20381352 21627864
sdc 1.33 37.86 64.91 12613800 21627864
sdd 0.03 1.79 4.90 595036 1633517
sde 0.03 1.80 4.90 600051 1633901
sdf 0.46 5.96 0.32 1986394 105040
md0 1.27 3.59 9.81 1194911 3267426
md1 9.12 99.03 63.51 32994976 21160984
- mpstat: Gives processor usage statistics:
asylum# mpstat
Linux 2.6.11-gentoo-r4 (asylum) 03/29/05
11:04:22 CPU %user %nice %system %iowait %irq %soft %idle intr/s
11:04:22 all 3.10 0.49 0.65 1.47 0.15 1.79 92.35 1139.36
- vmstat: A combination of iostat and mpstat:
asylum# vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
0 0 0 36776 96972 521040 0 0 1 50 110 125 4 3 92 1
- Where to get: Another part of the procps package.
- dstat: A colorized combination of iostat, vmstat, and ifstat.
- mtop: Like top but displays mysql queries.
- uname -a: Just tells you what kernel you are running. Usefull when asking for help.
asylum# uname -a
Linux asylum 2.6.11-gentoo-r4 #1 Thu Mar 17 18:19:23 EST 2005 i686 AMD Athlon(tm) processor AuthenticAMD GNU/Linux
- Where to get: Part of the GNU coreutils (or the older shellutils) package which should come with all distros.
- lsmod: Lists the kernel modules that are loaded:
dementia# lsmod
Module Size Used by
uhci_hcd 32016 0
usbcore 116708 3 uhci_hcd
snd_cs46xx 83688 0
snd_ac97_codec 72848 1 snd_cs46xx
snd_cmipci 32260 1
snd_opl3_lib 11200 1 snd_cmipci
snd_hwdep 9668 1 snd_opl3_lib
snd_mpu401_uart 8000 1 snd_cmipci
snd_rawmidi 26020 2 snd_cs46xx,snd_mpu401_uart
insomnia# lsmod
Module Size Used by
snd_interwave 19432 0
snd_gus_lib 62112 1 snd_interwave
snd_rawmidi 26592 1 snd_gus_lib
snd_cs4231_lib 28384 1 snd_interwave
- Where to get: Part of the module-init-tools package which should come with all distros.