proc



/proc下的文件。
 
cmdline项非常相似。 
[root@localhost proc]# cat cmdline 
ro root=LABEL=/ rhgb quiet 
-------------------------------------------------------------------------------- 
CPU的多种信息。这些信息是从内核里对386686等),以及能得到的更多特定信息(制造商,型号和版本)。文件还包含了以bug,文件还会包含相应的标志。这个文件的格式为:文件由多行构成,每行包括一个域名称,一个冒号和一个值。 
[root@localhost proc]# cat cpuinfo 
processor : 0 
vendor_id : AuthenticAMD 
cpu family : 6 
model : 8 
model name : AMD Athlon(tm) XP 1800+ 
stepping : 1 
cpu MHz : 1530.165 
cache size : 256 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 mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow 
bogomips : 2998.27 

这个文件给出了内核启动的命令行。它和用于进程的 
 

这个文件提供了有关系统CPU的普通型号(586CPU的多种特性或者 
 
这个文件列出字符和块设备的主设备号,以及分配到这些设备号的设备名称。 
[root@localhost /]# cat /proc/devices 
Character devices: 
1 mem 
4 /dev/vc/0 
4 tty 
4 ttyS 
5 /dev/tty 
5 /dev/console 
5 /dev/ptmx 
6 lp 
7 vcs 
10 misc 
13 input 
14 sound 
29 fb 
36 netlink 
116 alsa 
128 ptm 
136 pts 
180 usb
  casade项供用于把次 
/proc/filesystems
文件  
[root@localhost proc]# cat /proc/filesystems  
nodev sysfs 
nodev rootfs 
nodev bdev 
nodev proc
nodev sockfs 
nodev binfmt_misc 
nodev usbfs 
nodev usbdevfs 
nodev futexfs 
nodev tmpfs 
nodev pipefs 
nodev eventpollfs 
nodev devpts 
ext2 
nodev ramfs 
nodev hugetlbfs 
iso9660 
nodev mqueue 
nodev selinuxfs 
ext3 
nodev rpc_pipefs 
nodev autofs  
-------------------------------------------------------------------------------- 
SA_INTERRUPT标志设置),以及登记这个中断的驱动程序的名字。可以在安装新硬件前,像查看cat命令手工查看手头的这个文件。这几个文件列出了当前投入使用的资源(但是不包括那些没有加载驱动程序的硬件所使用的资源)。
/proc/ioports
文件  
示例:  
这个文件是系统的物理内存以/proc目录下为数不多的几个二进制格式的项之一。   
-------------------------------------------------------------------------------- 
printk 生成的内核消息。任何时刻只能有一个具有超级用户权限的进程可以读取这个文件。也可以用系统调用 klogd 检索这些消息。   
--------------------------------------------------------------------------------
ksyms,insmod  
示例: /proc/loadavg 文件 1 分钟,  
示例:  
这个文件包含在打开的文件上的加锁信息。文件中的每一行描述了特定文件和文档上的加锁信息以及对文件施加的锁的类型。内核也可以需要时对文件施加强制性锁。
 
这个文件包含了由 
示例: 
这个文件给出了内存状态的信息。它显示出系统中空闲内存,已用物理内存和交换内存的总量。它还显示出内核使用的共享内存和缓冲区总量。这些信息的格式和 
[root@localhost ~]# cat /proc/meminfo 
MemTotal:       223812 kB 
MemFree:          3764 kB 
Buffers:          9148 kB 
Cached:          92112 kB 
SwapCached:        364 kB 
Active:         183640 kB 
Inactive:        17196 kB 
HighTotal:           0 kB 
HighFree:            0 kB 
LowTotal:       223812 kB 
LowFree:          3764 kB 
SwapTotal:      626524 kB 
SwapFree:       620328 kB 
Dirty:              12 kB 
Writeback:           0 kB 
Mapped:         142880 kB 
Slab:            12668 kB 
Committed_AS:   376732 kB 
PageTables:       2336 kB 
VmallocTotal:  3907576 kB 
VmallocUsed:      2968 kB 
VmallocChunk:  3904224 kB 
HugePages_Total:     0 
HugePages_Free:      0 
Hugepagesize:     4096 kB 
-------------------------------------------------------------------------------- 
misc_register登记的设备驱动程序。/proc/modules文件
 
示例: 
[root@localhost /]# lsmod 
Module                  Size  Used by 
md5                     4033  1 
ipv6                  232577  8 
parport_pc             24705  1 
lp                     11565  0 
parport                41737  2 parport_pc,lp 
autofs4                24005  0 
i2c_dev                10433  0 
i2c_core               22081  1 i2c_dev 
sunrpc                160421  1 
ipt_REJECT              6465  1 
ipt_state               1857  5 
ip_conntrack           40693  1 ipt_state 
iptable_filter          2753  1 
ip_tables              16193  3 ipt_REJECT,ipt_state,iptable_filter 
dm_mod                 54741  0 
button                  6481  0 
battery                 8517  0 
ac                      4805  0 
uhci_hcd               31449  0 
ehci_hcd               31557  0 
snd_via82xx            27237  2 
snd_ac97_codec         64401  1 snd_via82xx 
snd_pcm_oss            47609  0 
snd_mixer_oss          17217  2 snd_pcm_oss 
snd_pcm                97993  2 snd_via82xx,snd_pcm_oss 
snd_timer              29765  1 snd_pcm 
snd_page_alloc          9673  2 snd_via82xx,snd_pcm 
gameport                4801  1 snd_via82xx 
snd_mpu401_uart         8769  1 snd_via82xx 
snd_rawmidi            26725  1 snd_mpu401_uart 
snd_seq_device          8137  1 snd_rawmidi 
snd                    54053  11 snd_via82xx,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_mpu401_uart,snd_rawmidi,snd_seq_device 
soundcore               9889  2 snd 
via_rhine              23497  0 
mii                     4673  1 via_rhine 
floppy                 58609  0 
ext3                  116809  1 
jbd                    74969  1 ext3  
-------------------------------------------------------------------------------- 
/etc/mtab文件的格式给出当前系统所安装的文件系统信息。这个文件也能反映出任何手工安装从而在 
[root@localhost /]# cat /proc/mounts 
rootfs / rootfs rw 0 0 
/proc /proc proc rw,nodiratime 0 0 
none /dev tmpfs rw 0 0 
/dev/root / ext3 rw 0 0 
none /dev tmpfs rw 0 0 
none /selinux selinuxfs rw 0 0 
/proc /proc proc rw,nodiratime 0 0 
/proc/bus/usb /proc/bus/usb usbfs rw 0 0 
/sys /sys sysfs rw 0 0 
none /dev/pts devpts rw 0 0 
none /dev/shm tmpfs rw 0 0 
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0 
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0  
-------------------------------------------------------------------------------- 
PCI设备的信息。用它可以方便地诊断USB控制器这样的设备,总线,设备和功能编号,设备延迟以及 
[root@localhost /]# cat /proc/pci 
PCI devices found: 
  Bus  0, device   0, function  0: 
    Class 0600: PCI device 1106:3116 (rev 0). 
      Master Capable.  Latency=8. 
      Prefetchable 32 bit memory at 0xe0000000 [0xe7ffffff]. 
  Bus  0, device   1, function  0: 
    Class 0604: PCI device 1106:b091 (rev 0). 
      Master Capable.  No bursts.  Min Gnt=12. 
  Bus  0, device  16, function  2: 
    Class 0c03: PCI device 1106:3038 (rev 128). 
      IRQ 5. 
      Master Capable.  Latency=32. 
      I/O at 0xec00 [0xec1f]. 
  Bus  0, device  16, function  1: 
    Class 0c03: PCI device 1106:3038 (rev 128). 
      IRQ 3. 
      Master Capable.  Latency=32. 
      I/O at 0xe800 [0xe81f]. 
  Bus  0, device  16, function  0: 
    Class 0c03: PCI device 1106:3038 (rev 128). 
    
  IRQ 11. 
      Master Capable.  Latency=32. 
      I/O at 0xe400 [0xe41f]. 
  Bus  0, device  16, function  3: 
    Class 0c03: PCI device 1106:3104 (rev 130). 
      IRQ 10. 
      Master Capable.  Latency=32. 
      Non-prefetchable 32 bit memory at 0xdfffff00 [0xdfffffff]. 
  Bus  0, device  17, function  0: 
    Class 0601: PCI device 1106:3177 (rev 0). 
  Bus  0, device  17, function  1: 
    Class 0101: PCI device 1106:0571 (rev 6). 
      IRQ 255. 
      Master Capable.  Latency=32. 
      I/O at 0xfc00 [0xfc0f]. 
  Bus  0, device  17, function  5: 
    Class 0401: PCI device 1106:3059 (rev 80). 
      IRQ 5. 
      I/O at 0xe000 [0xe0ff]. 
  Bus  0, device  18, function  0: 
    Class 0200: PCI device 1106:3065 (rev 116). 
      IRQ 11. 
      Master Capable.  Latency=32.  Min Gnt=3.Max Lat=8. 
      I/O at 0xdc00 [0xdcff]. 
      Non-prefetchable 32 bit memory at 0xdffffe00 [0xdffffeff]. 
  Bus  1, device   0, function  0: 
    Class 0300: PCI device 5333:8d04 (rev 0). 
      IRQ 11. 
      Master Capable.  Latency=32.  Min Gnt=4.Max Lat=255. 
      Non-prefetchable 32 bit memory at 0xdfe80000 [0xdfefffff]. 
      Prefetchable 32 bit memory at 0xd0000000 [0xd7ffffff].  
-------------------------------------------------------------------------------- 
 
这个文件包含的信息有1 
[root@localhost /]# cat /proc/stat 
cpu  31994 3898 7161 381600 15254 451 0 
cpu0 31994 3898 7161 381600 15254 451 0 
intr 4615930 4404290 3364 0 0 12 0 7 0 2 0 0 12618 112114 0 44142 39381 
ctxt 1310498 
btime 1148891913 
processes 4249 
procs_running 4 
procs_blocked 0  
-------------------------------------------------------------------------------- 
uptime程序使用。比较这两个数字能够告诉你长期来看 
[root@localhost /]# cat /proc/uptime 
4477.04 4021.10  
-------------------------------------------------------------------------------- 
 <span inherit','serif';="" color:="" green;="" mso-bidi-font-size:="" 10.5pt;="" mso-fareast-font-family:="" 宋体;="" mso-bidi-font-family:="" tahoma;="" mso-font-kerning:="" 0pt"="" lang="EN-US" style="padding: 0px; margin: 0px; ">
示例:<span inherit','serif';="" color:="" #2a2a2a;="" mso-bidi-font-size:="" 10.5pt;="" mso-fareast-font-family:="" 宋体;="" mso-bidi-font-family:="" tahoma;="" mso-font-kerning:="" 0pt"="" style="padding: 0px; margin: 0px; "> 
[root@localhost /]# cat /proc/version 
Linux version 2.6.9-1.667 (bhcompile@tweety.build.redhat.com) (gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)) #1 Tue Nov 2 14:41:25 EST 2004

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值