Proc File system for Linux

Source: Internet
Author: User

proc , the user space and the kernel space can communicate through this interface,

Unlike normal files. the contents of these virtual files are created dynamically.

proc file system is a pseudo file system, it only exists in memory, Without occupying external memory space.

it provides an interface for access to system kernel data in the form of a file system. Users and Applications

to pass proc get information about the system. And can change some of the kernel's parameters.

proc The file system can be used to collect useful information about the system and the kernel in execution.


Access to this file system is the same as for general documentation.

Cases:

1. Statistics CPU Number:

Cat/proc/cpuinfo | grep ' physical ID ' |uniq-c|wc–l

2.CPU model

Cat/proc/cpuinfo|grepname|cut-f2-d:|uniq

3.calculate each of theCPUthe number of cores

Cat/proc/cpuinfo | grep ' physical id ' |awk-f ': ' {count[$2]++;} End{sum=0;for (A in count) {cc++;sum+=count[a]}printsum/cc;} '

4.Kernel version number

Cat/proc/version|cut-f1-d ' ('

5.the number of context conversions that the kernel is running

Cat/proc/stat|grep Ctxt|awk ' {print $} '

6. Number of processes created by the system

Cat/proc/stat|grep Processes|awk ' {print $} '

7. The amount of memory currently available

Cat/proc/meminfo|grep Memfree




Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.

Proc File system for Linux

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.