PROC(5) File Formats Manual PROC(5) NAME proc - /proc , , /dev/kmem. /proc, . /proc . [number] /proc , ID , . cmdline . , , , . null . cwd , . , 20 cwd, : cd /proc/20/cwd; /bin/pwd pwd shell , . environ , , . , 1 , : (cat /proc/1/environ; echo) | tr ";\000"; ";\n"; (, lilo(8).) exe , . Linux 2.0 , exe readlink(2) : []: , [0301]:1502 1502 , 03 ( IDE, MFM ), 01 (). Linux 2.2 , readlink(2) . , ( exe ). /proc/[number]/exe [number] . -inum find(1) . fd , , exe , 0 , 1 , 2 , . ( -i , -o ): foobar -i /proc/self/fd/0 -o /proc/self/fd/1 ... . , fd . UNIX , /proc/self/fd/N /dev/fd/N . , Linux MAKEDEV /dev/fd [..]/proc/self/fd . maps . : address perms offset dev inode 00000000-0002f000 r-x-- 00000400 03:03 1401 0002f000-00032000 rwx-p 0002f400 03:03 1401 00032000-0005b000 rwx-p 00000000 00:00 0 60000000-60098000 rwx-p 00000400 03:03 215 60098000-600c7000 rwx-p 00000000 00:00 0 bfffa000-c0000000 rwx-p 00000000 00:00 0 address , perms : r = read w = write x = execute s = shared p = private (copy on write) offset , dev ( :), inode . 0 , bss . Linux 2.2 . mem mem (1:1) , . /dev/mem , mem . mem mmap(2) mmap(2) () mmap mmap(2) maps exe, fd/* . maps /proc/*/mmap , mmap. ";0"; libc.so.4. linux 1.1.40 , /proc/*/mmap . ( !) root chroot(2), unix linux . chroot(2) exe, fd/* stat , ps(1) . , scanf(3) , : pid %d comm %s , . . state %c ";RSDZT"; , R , S , D , Z , T (). ppid %d PID. pgrp %d ID. session %d ID. tty %d . tpgid %d ID. flags %u . , . crt0.s , c . 4, 10. minflt %u minor faults, minor faults . cminflt %u minor faults. majflt %u major faults, major faults. cmajflt %u major faults. utime %d ( jiffy , 1 jiffy=1/100 ). stime %d , jiffy . cutime %d , jiffy . cstime %d , jiffy . counter %d , , jiffy . , jiffy . priority %d 15, . timeout %u , jiffy . itrealvalue %u SIGALRM jiffy . starttime %d , jiffy . vsize %u . rss %u Resident Set Size: , , 3. rss , , . rlim %u rss , , 2,147,483,647. startcode %u . endcode %u . startstack %u . kstkesp %u esp(32 ) , . kstkeip %u EIP(32 ). signal %d bitmap( 0). blocked %d bitmap( shell 0, 2) sigignore %d bitmap. sigcatch %d bitmap. wchan %u , . , . ( /etc/psdatabase, ps -l WCHAN ) cpuinfo CPU . , cpu BogoMIPS, cpu CPU, BogoMIPS . devices , . MAKEDEV . dma , ISA DMA (). filesystems . mount(1) , mount(1) . interrupts ASCII i386 IRQ . ioports I/O . kcore core , (/usr/src/linux/tools/zSystem), GDB . (RAM) 4KB. kmsg syslog(2) . , , syslog(2) , . dmesg(8) . ksyms , modules(X) . loadavg 1, 5, 15 , uptime(1) . locks malloc CONFIGDEBUGMALLOC meminfo free(1) (), . free(1) , KB. modules , . net ASCII , . cat , netstat(8) . arp ASCII ARP , , arp . : IP address HW type Flags HW address 10.11.100.129 0x1 0x6 00:20:8A:00:0C:5A 10.11.100.5 0x1 0x2 00:C0:EA:00:00:4E 44.131.10.6 0x3 0x2 GW4PTS 'IP address' IPv4 ; 'HW type' , RFC 826; flags ARP , /usr/include/linux/if_arp.h ; 'HW address' IP (). dev , , , . ifconfig(8) . : Inter-| Receive | Transmit face |packets errs drop fifo frame|packets errs drop fifo colls carrier lo: 0 0 0 0 0 2353 0 0 0 0 0 eth0: 644324 1 0 0 1 563770 0 0 0 581 0 ipx . ipx_route . rarp arp , . rarp(8) . RARP , . raw RAW , . `sl' ; 'local address' ; "St" ; tx_queue rx_queue ; RAW "tr", "tm->when" "rexmits"; uid uid. route , route(8) snmp ASCII IP, ICMP, TCP UDP , snmp . TCP mib (TCP ), 1.2.0 . tcp TCP , . "sl" ; "local address" ; "remote address" (); 'St' ; 'tx_queue' 'rx_queue' ; "tr", "tm->when" "rexmits" , ; uid uid. udp UDP , . "sl" ; "local address" ; "remote address" (); "St" ; "tx_queue" "rx_queue" ; UDP "tr","tm->when" "rexmits"; uid uid. : sl local_address rem_address st tx_queue rx_queue tr rexmits tm->when uid 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 unix UNIX, : Num RefCount Protocol Flags Type St Path 0: 00000002 00000000 00000000 0001 03 1: 00000001 00000000 00010000 0001 01 /dev/printer `Num' ; 'RefCount' ; 'Protocol' 0; 'Flags' , ; 'Type' 1( unix ); 'St' ; 'Path' (). pci PCI . scsi scsi SCSI , SCSI host, , SCSI IO . ASCII , cat. , . scsi SCSI , . scsi singledevice, root (hotplugged). echo 'scsi singledevice 1 0 5 0' > /proc/scsi/scsi host scsi1 SCSI 0, ID 5 LUN 0 , , , . drivername drivername : NCR53c7xx, aha152x, aha1542, aha1740, aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic, scsi_debug, seagate, t128, u15-24f, ultrastore wd7000. SCSI HBA . host, , host host . , . host . , root latency nolatency eata_dma , lockup unlock scsi_debug . self /proc , /proc ID . stat . cpu 3357 0 4313 1362393 , nice, , , jiffy . uptime 100 . disk 0 0 0 0 , I/O , . page 5741 1808 swap 1 0 . intr 1462898 . ctxt 115315 . btime 769041601 1970 1 1 , . sys 1.3.57 , . , proc, sysctl(2) . : kernel;, ;net;, ;vm . kernel : domainname;, ;file-max;, ;file-nr;, ;hostname;, ; inode-max;, ;inode-nr;, ;osrelease;, ;ostype;, ; panic;, ;real-root-dev;, ;securelevel;, ;version, . file-nr . file-max . 1024 , echo 4096 > /proc/sys/kernel/file-max , inode-nr inode-max inode inode . ostype;, ;osrelease;, ;version /proc/version panic panic_timeout / , panic ; , , . securelevel - root . uptime : , . version , : Linux version 1.0.9 (quinlan@phaze) #1 Sat May 14 01:51:54 EDT 1994 cat(1), find(1), free(1), mount(1), ps(1), tr(1), uptime(1), readlink(2), mmap(2), chroot(2), syslog(2), hier(7), arp(8), dmesg(8), netstat(8), route(8), ifconfig(8), procinfo(8). Linux 1.3.11 , ! Linux 1.3.11. (), NUL , od -c tr ";\000"; ";\n"; . , , . BUGS /proc chroot(2) . , /proc mount chroot , /proc/1/root chdir(2) . Linux fchroot(2) , bug. [] mapping [] 2000/11/26 linuxman: http://cmpp.linuxforum.net man man https://github.com/man-pages-zh/manpages- zh Linux Programmer's Manual 22 July 1996 PROC(5)