What's the use of files in the/proc directory in Linux

Source: Internet
Author: User
Tags command line file system reserved

Multiple files under the/proc file system provide system information that is not specific to a particular process, but can be used throughout the system-wide context. The files that you can use vary depending on your system configuration. Command ProcInfo can display a variety of system information based on some of these files. The following is a detailed description of the files under/Proc.

--------------------------------------------------------------------------------

/proc/cmdline file

This file gives the kernel-initiated command line. It is very similar to the CmdLine item used for the process.

---- ----------------------------------------------------------------------------

/proc/cpuinfo file

This file provides a variety of information about the system CPU. This information is obtained from the kernel's test code for the CPU. The file lists the common CPU models (386, 486,586,686, etc.), as well as more specific information (manufacturer, model, and version). The file also contains the processor speed represented in Bogomips, and if a variety of features or bugs are detected on the CPU, the file also contains the corresponding flags. The format of this file is: A file consists of multiple lines, each containing a domain name, a colon, and a value.

-------------------------------------------------------------------------- ------

/proc/devices file

This file lists the main device numbers for the characters and block devices, and the name of the device assigned to those device numbers.

--------------------------------------------------------------------------------

/PROC/DMA file

This file lists the DMA channels reserved by the driver and the name of the driver that retains them. The Casade item is used for DMA lines that are used to separate the secondary DMA controller from the primary controller, and this line cannot be used for other purposes.

----------------------------------------------------------- ---------------------

/proc/filesystems file

This file lists the file system types available for use, one row for the type. Although they are typically file system types that are encoded into the kernel, the file can also contain additional file system types that can be loaded by a kernel module.

------ --------------------------------------------------------------------------

/proc/interrupts file

Each row of this file has a reserved interrupt. The fields in each row are: The interrupt number, the number of times the line has been interrupted, possibly with a plus field (Sa_interrupt flag setting), and the name of the driver registering the interrupt. You can manually view the file at hand before installing new hardware, like viewing/PROC/DMA and/proc/ioports, with cat commands. These files list the resources currently in use (but not those used by hardware that does not load the driver).

-------------------------------------------------------------------- ------------

/proc/ioports file

This file lists many I/O port ranges that are registered with a variety of device drivers, such as disk drives, Ethernet cards, and sound card devices.

--------------------------------------------------------------------------- -----

/proc/kcore file

This file is the file that the system's physical memory is saved in the core file format. For example, GDB can use it to examine the data structure of the kernel. It is not plain text, but one of the few binary formats in the/proc directory.

------------------------- ------------------------------------------------------

/proc/kmsg file

This file is used to retrieve kernel messages generated with PRINTK. Only one process with superuser privileges can read this file at any given time. You can also retrieve these messages with system call syslog. These messages are usually retrieved using tool DMESG or daemon klogd.

------------------------------------------------------ --------------------------

/proc/ksyms file

This file lists the registered kernel symbols, which give the address of the variable or function. Each line gives the address of a symbol, the symbol name, and the module that registers the symbol. Program Ksyms,insmod and Kmod use this file. It also lists the number of tasks that are running, the number of overages, and the last allocated PID.

--------------------------------------------------------------------------------p://www.armforum.cn

/proc/loadavg file

This file gives the system average load calculated at several different intervals, as shown by the uptime command. The first three digits are the average load. This is achieved by calculating the average number of tasks in the run queue for the past 1 minutes, 5 minutes, and 15 minutes. Then there are the number of tasks and overages that are running. Finally, the process number that was last used.

--------------------------------------------------------------------------------

/proc/locks file

This file contains the lock information on the open file. Each row in the file describes the lock information on specific files and documents and the types of locks imposed on the file. The kernel can also impose a mandatory lock on the file when needed.

------------------------------------------------------ --------------------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.