Chinaunix首页 | 论坛 | 博客
  • 博客访问: 113557
  • 博文数量: 29
  • 博客积分: 2615
  • 博客等级: 少校
  • 技术积分: 461
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-28 16:01
文章分类

全部博文(29)

文章存档

2012年(1)

2011年(4)

2010年(4)

2009年(4)

2008年(16)

分类: LINUX

2011-06-16 16:48:26

Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-font-kerning:1.0pt;}

The proc file system

         Linux内核有两个主要功能:控制访问计算机上的物理设备和安排何时以及如何处理与这些设备进行交互/ proc /目录(也称为proc文件系统)包含了一系列代表了内核的当前状态,允许应用程序和用户同行到内核系统视图特殊文件的层次结构

/ proc /目录中包含丰富的系统硬件和所有正在运行的进程的详细信息此外,/proc中,某些文件可以被用户和应用程序操纵进行通信配置更改内核。

/proc/interrupts, /proc/meminfo, /proc/mounts, and /proc/partitions包含了up-to-the-moment glimpse的系统硬件信息。/proc/filesystems文件和/proc/sys目录提供了系统配置信息和接口。

修改一个虚拟文件的配置,可以使用下面的命令:

echo NewValue > /proc/file

例如修改系统的hostname,可以使用下面的命令:

         echo > /proc/sys/kernel/hostname

         例如开启系统ipv4的数据包转发,可以使用下面的命令:

         echo 1 > /proc/sys/net/ipv4/ip_forward

         另外。/sbin/sysctl命令可以修改/proc/sys目录下文件的配置。

 

1/proc/buddyinfo

         这个文件主要用于诊断内存碎片问题

2/proc/cmdline

         这个文件显示启动时向内核传递的参数。例如:

         ro root=/dev/VolGroup00/LogVol00 rhgb quiet 3

         这告诉我们以只读方式挂载kernel,位于第一个逻辑卷组的第一个逻辑卷。Rhgb表示将以图形界面方式启动,前提是rhgb包已经安装,并且启动级别为5Quiet将屏蔽启动时内核输出的详细信息。

3/proc/cpuinfo

         这个虚拟文件标示系统使用的cpu类型以及相关的参数。

4/proc/crypto

         该文件列出了所有已安装Linux内核使用加密的密码,包括每个细节

5/proc/devices

         这个文件显示了所有已经配置的字符设备和块设备。显示内容包括了设备的主设备号和名称。

         字符设备不需要缓冲。设备都提供一个可以的缓冲让他们为了解决这些之前请求问题

         字符设备发送没有预先设定的大小的数据块设备可以发送和接收设备上配置一个块大小的信息

6/proc/dma

         该文件包含了注册使用ISA DMA通道列表

7/proc/execdomains

         该文件列出了目前Linux内核支持的执行随着个性,他们支持的范围。

8/proc/fb

         该文件包含了缓冲设备的列表,缓冲设备的数量和控制它的驱动程序

9/proc/filesystems

         该文件显示了目前由内核支持的文件系统类型列表。nodev为行首的标示没有该类型的设备被mount

10/proc/interrupts

         这个文件记录了x86架构中每个IRQ中断数量。

         第一列是指IRQ系统中的每个CPU都有自己的列及其每个IRQ中断号码下一列报告的中断类型,最后一列包含位于IRQ的设备名称

11/proc/iomem

         此文件显示您每个物理设备的系统内存当前映射。

12/proc/ioports

         / proc/ ioports的输出内容中提供了当前注册的设备输入或输出与通信的端口区域的名单

13/proc/kcore

         该文件代表了系统的物理内存,并在核心文件格式存储与大多数/ proc/文件不同,kcore显示大小。这个值给定的字节并且大小等于使用的物理内存加上4 KB

14/proc/kmsg

         这个文件用来存放由内核产生的消息这些消息然后被其他程序获取,比如/ sbin/ klogd/ bin/dmesg

15/proc/loadavg

         此文件提供关于随着时间的推移CPUIO的负载以及由uptime其他命令使用其他数据平均负载的样子。

         前三列度量最后一,五,15分钟时期CPUIO的使用。第四列显示了当前正在运行的进程和进程的总数量。最后一栏显示的最后一个进程ID的。

16/proc/locks

         该文件显示当前由内核锁定的文件。这个文件的内容包含内部内核调试数据,根据系统的使用情况,这个内容可以千差万别

17/proc/mdstat

         这个文件包含当前系统中的多磁盘和RAID配置信息。

18/proc/meminfo

         系统RAM使用的信息。


  1. l MemTotal — Total amount of physical RAM, in kilobytes.

  2. l MemFree — The amount of physical RAM, in kilobytes, left unused by the system.

  3. l Buffers — The amount of physical RAM, in kilobytes, used for file buffers.

  4. l Cached — The amount of physical RAM, in kilobytes, used as cache memory.

  5. l SwapCached — The amount of swap, in kilobytes, used as cache memory.

  6. l Active — The total amount of buffer or page cache memory, in kilobytes, that is in active use. This is memory that has been recently used and is usually not reclaimed for other purposes.

  7. l Inactive — The total amount of buffer or page cache memory, in kilobytes, that are free and available. This is memory that has not been recently used and can be reclaimed for other purposes.

  8. l HighTotal and HighFree — The total and free amount of memory, in kilobytes, that is not directly mapped into kernel space. The HighTotal value can vary based on the type of kernel used.

  9. l LowTotal and LowFree — The total and free amount of memory, in kilobytes, that is directly mapped into kernel space. The LowTotal value can vary based on the type of kernel used.

  10. l SwapTotal — The total amount of swap available, in kilobytes.

  11. l SwapFree — The total amount of swap free, in kilobytes.

  12. l Dirty — The total amount of memory, in kilobytes, waiting to be written back to the disk.

  13. l Writeback — The total amount of memory, in kilobytes, actively being written back to the disk.

  14. l Mapped — The total amount of memory, in kilobytes, which have been used to map devices, files, or libraries using the mmap command.

  15. l Slab — The total amount of memory, in kilobytes, used by the kernel to cache data structures for its own use.

  16. l Committed_AS — The total amount of memory, in kilobytes, estimated to complete the workload.

  17. l This value represents the worst case scenario value, and also includes swap memory.

  18. l PageTables — The total amount of memory, in kilobytes, dedicated to the lowest page table level.

  19. l VMallocTotal — The total amount of memory, in kilobytes, of total allocated virtual address space.

  20. l VMallocUsed — The total amount of memory, in kilobytes, of used virtual address space.

  21. l VMallocChunk — The largest contiguous block of memory, in kilobytes, of available virtual address space.

  22. l HugePages_Total — The total number of hugepages for the system. The number is derived by

  23. l dividing Hugepagesize by the megabytes set aside for hugepages specified in /proc/sys/vm/

  24. l hugetlb_pool. This statistic only appears on the x86, Itanium, and AMD64 architectures.

  25. l HugePages_Free — The total number of hugepages available for the system. This statistic only

  26. l appears on the x86, Itanium, and AMD64 architectures.

  27. l Hugepagesize — The size for each hugepages unit in kilobytes. By default, the value is 4096KB on uniprocessor kernels for 32 bit architectures. For SMP, hugemem kernels, and AMD64, the default is 2048 KB. For Itanium architectures, the default is 262144 KB. This statistic only appears on the x86, Itanium, and AMD64 architectures.

19/proc/modules

         该文件显示了加载到内核的所有模块的列表。

20/proc/mounts

         此文件提供系统所有挂载设备的列表。

21/proc/mtrr

         该文件指的是当前系统的使用MTRR

22/proc/partitions

         该文件包含分区块分配信息。内容包括主设备号、次设备号、块、设备名称。

23/proc/slabinfo

         slab层下的内存使用的所有信息。

24/proc/stat

         这个文件记录了大量有关系统的各种不同的统计跟踪自上次重新启动。

25/proc/swaps

         这个文件显示当前swap分区的使用情况。

26/proc/uptime

         这个文件包含自上次重启系统逝去了多少时间。

27/proc/version

         这个文件保存系统的相关版本信息。

阅读(889) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~