Last time we talked about how /proc has directories for each process but that there were also some files in that directory. This time we’ll talk about a couple of those files. /proc and its files have lots of information about the running of your system.
Let’s start with meminfo. That’s a weird name, right? Well, surprise, surprise, it has something to do with memory. It has the current state of the memory on your system.
MemTotal: 32953488 kB MemFree: 12891648 kB Buffers: 56460 kB Cached: 7736136 kB SwapCached: 720288 kB Active: 12263732 kB Inactive: 5540668 kB Active(anon): 9316432 kB Inactive(anon): 3067828 kB Active(file): 2947300 kB Inactive(file): 2472840 kB Unevictable: 26100 kB Mlocked: 15880 kB SwapTotal: 3117180 kB SwapFree: 1736868 kB Dirty: 1820 kB Writeback: 0 kB AnonPages: 9560840 kB Mapped: 2414060 kB Shmem: 2369068 kB Slab: 768816 kB SReclaimable: 521000 kB SUnreclaim: 247816 kB KernelStack: 18416 kB PageTables: 365784 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 19593924 kB Committed_AS: 27252100 kB VmallocTotal: 34359738367 kB VmallocUsed: 276548 kB VmallocChunk: 34359361512 kB AnonHugePages: 491520 kB DirectMap4k: 7488 kB DirectMap2M: 4179968 kB DirectMap1G: 29360128 kB
That’s a lot of information and we don’t really care what it all means. The first two lines are the interesting part, they tell us the total memory on the system (in kilobytes). This system has 32 Gigabytes of memory installed on it and 39% of it is being used. (I figured that out by dividing the amount of memory being used by the memory on the system).
Another file is the devices file. That’s a list of devices on the system. Remember, /dev/ has a list of all possible devices, the devices file in /proc has a list of all the devices on the system. I can cat that one and see:
Character devices: 1 mem 2 pty 3 ttyp 4 /dev/vc/0 4 tty 5 /dev/tty 5 /dev/console 5 /dev/ptmx 7 vcs 10 misc 13 input 108 ppp 128 ptm 136 pts 229 hvc 254 uio Block devices: 1 ramdisk 259 blkext 7 loop 9 md 43 nbd 147 drbd 202 xvd 253 device-mapper 254 mdp
So the question now is, what’s a block device and what’s a character device? Tune in next time for more information… Same bat time, same bat station!