zoukankan      html  css  js  c++  java
  • Linux系统目录结构详解

    一、目录层级标准

      Linux是一个开源软件,任何一个组织都有获取、修改使用的权限,这也就造成了Linux有不同的发行版本。如果每一个发行版本的厂商都按照自己的标准来定义目录结构,势必会造成Linux版本混乱,为了防止linux发行版本的混乱,linux基金会制定了一个标准,这就是著名的filesystem hierarchy standard.简称FHS标准。所有Linux发行版本都要遵循FHS制定的Linux目录层级标准。

      FHS定义了两层规范:

    • 第一层是"/"目录下的各目录应该放什么文件数据,例如,/etc目录下放置系统的配置文件;/bin和/sbin放置程序及系统命令
    • 第二层是针对"/usr和/var"这两个目录的子目录来定义,例如,/var/log下放置系统日志文件等

    二、"/"目录结构

    Linux系统目录结构最顶端的就是"/",称之为根目录。它是Linux系统中所有目录的起始点,是一个倒着的树状结构:

    [root@localhost /]# tree -L 1
    .
    ├── bin -> usr/bin
    ├── boot
    ├── dev
    ├── etc
    ├── home
    ├── lib -> usr/lib
    ├── lib64 -> usr/lib64
    ├── media
    ├── mnt
    ├── opt
    ├── proc
    ├── root
    ├── run
    ├── sbin -> usr/sbin
    ├── srv
    ├── sys
    ├── tmp
    ├── usr
    └── var

    1、/bin

    常用二进制命令所在的目录,比如ls、cp、rm等,与/usr/bin类似。

    2、/boot

    Linux内核及引导系统程序所需的文件目录,安装系统分区时一般要分一个boot分区(100-200M)。

    [root@localhost boot]# ll
    total 92532
    -rw-r--r--. 1 root root   137696 Nov 23  2016 config-3.10.0-514.el7.x86_64
    drwxr-xr-x. 2 root root       27 Oct  1 14:28 grub
    drwx------. 6 root root      111 Oct  1 14:34 grub2
    -rw-------. 1 root root 45048229 Oct  1 14:34 initramfs-0-rescue-34b9877a4aa04cf5bf1b7d0691c70b2f.img
    -rw-------. 1 root root 18355755 Oct  1 14:34 initramfs-3.10.0-514.el7.x86_64.img
    -rw-------. 1 root root 16401591 Oct  1 14:46 initramfs-3.10.0-514.el7.x86_64kdump.img
    -rw-r--r--. 1 root root   613740 Oct  1 14:30 initrd-plymouth.img
    -rw-r--r--. 1 root root   277953 Nov 23  2016 symvers-3.10.0-514.el7.x86_64.gz
    -rw-------. 1 root root  3113253 Nov 23  2016 System.map-3.10.0-514.el7.x86_64
    -rwxr-xr-x. 1 root root  5392080 Oct  1 14:34 vmlinuz-0-rescue-34b9877a4aa04cf5bf1b7d0691c70b2f
    -rwxr-xr-x. 1 root root  5392080 Nov 23  2016 vmlinuz-3.10.0-514.el7.x86_64
    [root@localhost boot]# 
    View Code

    3、/dev

    设备文件的目录,如:磁盘、光驱等。

    [root@localhost dev]# ll
    total 0
    crw-rw---- 1 root video    10, 175 Oct 17 10:51 agpgart
    crw------- 1 root root     10, 235 Oct 17 10:51 autofs
    drwxr-xr-x 2 root root         140 Oct 17 10:51 block
    drwxr-xr-x 2 root root          80 Oct 17 10:51 bsg
    crw------- 1 root root     10, 234 Oct 17 10:51 btrfs-control
    drwxr-xr-x 3 root root          60 Oct 17 10:51 bus
    lrwxrwxrwx 1 root root           3 Oct 17 10:51 cdrom -> sr0
    drwxr-xr-x 2 root root        3020 Oct 17 10:51 char
    crw------- 1 root root      5,   1 Oct 17 10:51 console
    lrwxrwxrwx 1 root root          11 Oct 17 10:51 core -> /proc/kcore
    drwxr-xr-x 3 root root          80 Oct 17 10:51 cpu
    crw------- 1 root root     10,  61 Oct 17 10:51 cpu_dma_latency
    crw------- 1 root root     10,  62 Oct 17 10:51 crash
    drwxr-xr-x 6 root root         120 Oct 17 10:51 disk
    crw-rw---- 1 root audio    14,   9 Oct 17 10:51 dmmidi
    drwxr-xr-x 2 root root         100 Oct 17 10:51 dri
    crw-rw---- 1 root video    29,   0 Oct 17 10:51 fb0
    lrwxrwxrwx 1 root root          13 Oct 17 10:51 fd -> /proc/self/fd
    crw-rw-rw- 1 root root      1,   7 Oct 17 10:51 full
    crw-rw-rw- 1 root root     10, 229 Oct 17 10:51 fuse
    crw------- 1 root root    249,   0 Oct 17 10:51 hidraw0
    crw------- 1 root root     10, 228 Oct 17 10:51 hpet
    drwxr-xr-x 2 root root           0 Oct 17 10:51 hugepages
    lrwxrwxrwx 1 root root          25 Oct 17 10:51 initctl -> /run/systemd/initctl/fifo
    drwxr-xr-x 4 root root         280 Oct 17 10:51 input
    crw-r--r-- 1 root root      1,  11 Oct 17 10:51 kmsg
    srw-rw-rw- 1 root root           0 Oct 17 10:51 log
    crw-rw---- 1 root disk     10, 237 Oct 17 10:51 loop-control
    drwxr-xr-x 2 root root          60 Oct 17 10:51 mapper
    crw------- 1 root root     10, 227 Oct 17 10:51 mcelog
    crw-r----- 1 root kmem      1,   1 Oct 17 10:51 mem
    crw-rw---- 1 root audio    14,   2 Oct 17 10:51 midi
    drwxrwxrwt 2 root root          40 Oct 17 10:51 mqueue
    drwxr-xr-x 2 root root          60 Oct 17 10:51 net
    crw------- 1 root root     10,  60 Oct 17 10:51 network_latency
    crw------- 1 root root     10,  59 Oct 17 10:51 network_throughput
    crw-rw-rw- 1 root root      1,   3 Oct 17 10:51 null
    crw------- 1 root root     10, 144 Oct 17 10:51 nvram
    crw------- 1 root root      1,  12 Oct 17 10:51 oldmem
    crw-r----- 1 root kmem      1,   4 Oct 17 10:51 port
    crw------- 1 root root    108,   0 Oct 17 10:51 ppp
    crw-rw-rw- 1 root tty       5,   2 Oct 17 12:04 ptmx
    drwxr-xr-x 2 root root           0 Oct 17 10:51 pts
    crw-rw-rw- 1 root root      1,   8 Oct 17 10:51 random
    drwxr-xr-x 2 root root          60 Oct 17 10:51 raw
    crw-rw-r-- 1 root root     10,  57 Oct 17 10:51 rfkill
    lrwxrwxrwx 1 root root           4 Oct 17 10:51 rtc -> rtc0
    crw------- 1 root root    253,   0 Oct 17 10:51 rtc0
    brw-rw---- 1 root disk      8,   0 Oct 17 10:51 sda
    brw-rw---- 1 root disk      8,   1 Oct 17 10:51 sda1
    brw-rw---- 1 root disk      8,   2 Oct 17 10:51 sda2
    brw-rw---- 1 root disk      8,   3 Oct 17 10:51 sda3
    crw-rw---- 1 root disk     21,   0 Oct 17 10:51 sg0
    crw-rw---- 1 root cdrom    21,   1 Oct 17 10:51 sg1
    drwxrwxrwt 2 root root          40 Oct 17 10:51 shm
    crw------- 1 root root     10, 231 Oct 17 10:51 snapshot
    drwxr-xr-x 3 root root         200 Oct 17 10:51 snd
    brw-rw---- 1 root cdrom    11,   0 Oct 17 10:51 sr0
    lrwxrwxrwx 1 root root          15 Oct 17 10:51 stderr -> /proc/self/fd/2
    lrwxrwxrwx 1 root root          15 Oct 17 10:51 stdin -> /proc/self/fd/0
    lrwxrwxrwx 1 root root          15 Oct 17 10:51 stdout -> /proc/self/fd/1
    crw-rw-rw- 1 root tty       5,   0 Oct 17 10:51 tty
    crw--w---- 1 root tty       4,   0 Oct 17 10:51 tty0
    crw--w---- 1 root tty       4,   1 Oct 17 10:51 tty1
    crw--w---- 1 root tty       4,  10 Oct 17 10:51 tty10
    crw--w---- 1 root tty       4,  11 Oct 17 10:51 tty11
    crw--w---- 1 root tty       4,  12 Oct 17 10:51 tty12
    crw--w---- 1 root tty       4,  13 Oct 17 10:51 tty13
    crw--w---- 1 root tty       4,  14 Oct 17 10:51 tty14
    crw--w---- 1 root tty       4,  15 Oct 17 10:51 tty15
    crw--w---- 1 root tty       4,  16 Oct 17 10:51 tty16
    crw--w---- 1 root tty       4,  17 Oct 17 10:51 tty17
    crw--w---- 1 root tty       4,  18 Oct 17 10:51 tty18
    crw--w---- 1 root tty       4,  19 Oct 17 10:51 tty19
    crw--w---- 1 root tty       4,   2 Oct 17 10:51 tty2
    crw--w---- 1 root tty       4,  20 Oct 17 10:51 tty20
    crw--w---- 1 root tty       4,  21 Oct 17 10:51 tty21
    crw--w---- 1 root tty       4,  22 Oct 17 10:51 tty22
    crw--w---- 1 root tty       4,  23 Oct 17 10:51 tty23
    crw--w---- 1 root tty       4,  24 Oct 17 10:51 tty24
    crw--w---- 1 root tty       4,  25 Oct 17 10:51 tty25
    crw--w---- 1 root tty       4,  26 Oct 17 10:51 tty26
    crw--w---- 1 root tty       4,  27 Oct 17 10:51 tty27
    crw--w---- 1 root tty       4,  28 Oct 17 10:51 tty28
    crw--w---- 1 root tty       4,  29 Oct 17 10:51 tty29
    crw--w---- 1 root tty       4,   3 Oct 17 10:51 tty3
    crw--w---- 1 root tty       4,  30 Oct 17 10:51 tty30
    crw--w---- 1 root tty       4,  31 Oct 17 10:51 tty31
    crw--w---- 1 root tty       4,  32 Oct 17 10:51 tty32
    crw--w---- 1 root tty       4,  33 Oct 17 10:51 tty33
    crw--w---- 1 root tty       4,  34 Oct 17 10:51 tty34
    crw--w---- 1 root tty       4,  35 Oct 17 10:51 tty35
    crw--w---- 1 root tty       4,  36 Oct 17 10:51 tty36
    crw--w---- 1 root tty       4,  37 Oct 17 10:51 tty37
    crw--w---- 1 root tty       4,  38 Oct 17 10:51 tty38
    crw--w---- 1 root tty       4,  39 Oct 17 10:51 tty39
    crw--w---- 1 root tty       4,   4 Oct 17 10:51 tty4
    crw--w---- 1 root tty       4,  40 Oct 17 10:51 tty40
    crw--w---- 1 root tty       4,  41 Oct 17 10:51 tty41
    crw--w---- 1 root tty       4,  42 Oct 17 10:51 tty42
    crw--w---- 1 root tty       4,  43 Oct 17 10:51 tty43
    crw--w---- 1 root tty       4,  44 Oct 17 10:51 tty44
    crw--w---- 1 root tty       4,  45 Oct 17 10:51 tty45
    crw--w---- 1 root tty       4,  46 Oct 17 10:51 tty46
    crw--w---- 1 root tty       4,  47 Oct 17 10:51 tty47
    crw--w---- 1 root tty       4,  48 Oct 17 10:51 tty48
    crw--w---- 1 root tty       4,  49 Oct 17 10:51 tty49
    crw--w---- 1 root tty       4,   5 Oct 17 10:51 tty5
    crw--w---- 1 root tty       4,  50 Oct 17 10:51 tty50
    crw--w---- 1 root tty       4,  51 Oct 17 10:51 tty51
    crw--w---- 1 root tty       4,  52 Oct 17 10:51 tty52
    crw--w---- 1 root tty       4,  53 Oct 17 10:51 tty53
    crw--w---- 1 root tty       4,  54 Oct 17 10:51 tty54
    crw--w---- 1 root tty       4,  55 Oct 17 10:51 tty55
    crw--w---- 1 root tty       4,  56 Oct 17 10:51 tty56
    crw--w---- 1 root tty       4,  57 Oct 17 10:51 tty57
    crw--w---- 1 root tty       4,  58 Oct 17 10:51 tty58
    crw--w---- 1 root tty       4,  59 Oct 17 10:51 tty59
    crw--w---- 1 root tty       4,   6 Oct 17 10:51 tty6
    crw--w---- 1 root tty       4,  60 Oct 17 10:51 tty60
    crw--w---- 1 root tty       4,  61 Oct 17 10:51 tty61
    crw--w---- 1 root tty       4,  62 Oct 17 10:51 tty62
    crw--w---- 1 root tty       4,  63 Oct 17 10:51 tty63
    crw--w---- 1 root tty       4,   7 Oct 17 10:51 tty7
    crw--w---- 1 root tty       4,   8 Oct 17 10:51 tty8
    crw--w---- 1 root tty       4,   9 Oct 17 10:51 tty9
    crw-rw---- 1 root dialout   4,  64 Oct 17 10:51 ttyS0
    crw-rw---- 1 root dialout   4,  65 Oct 17 10:51 ttyS1
    crw-rw---- 1 root dialout   4,  66 Oct 17 10:51 ttyS2
    crw-rw---- 1 root dialout   4,  67 Oct 17 10:51 ttyS3
    crw------- 1 root root     10, 239 Oct 17 10:51 uhid
    crw------- 1 root root     10, 223 Oct 17 10:51 uinput
    crw-rw-rw- 1 root root      1,   9 Oct 17 10:51 urandom
    crw------- 1 root root    250,   0 Oct 17 10:51 usbmon0
    crw------- 1 root root    250,   1 Oct 17 10:51 usbmon1
    crw------- 1 root root    250,   2 Oct 17 10:51 usbmon2
    crw-rw---- 1 root tty       7,   0 Oct 17 10:51 vcs
    crw-rw---- 1 root tty       7,   1 Oct 17 10:51 vcs1
    crw-rw---- 1 root tty       7,   2 Oct 17 10:51 vcs2
    crw-rw---- 1 root tty       7,   3 Oct 17 10:51 vcs3
    crw-rw---- 1 root tty       7,   4 Oct 17 10:51 vcs4
    crw-rw---- 1 root tty       7,   5 Oct 17 10:51 vcs5
    crw-rw---- 1 root tty       7,   6 Oct 17 10:51 vcs6
    crw-rw---- 1 root tty       7, 128 Oct 17 10:51 vcsa
    crw-rw---- 1 root tty       7, 129 Oct 17 10:51 vcsa1
    crw-rw---- 1 root tty       7, 130 Oct 17 10:51 vcsa2
    crw-rw---- 1 root tty       7, 131 Oct 17 10:51 vcsa3
    crw-rw---- 1 root tty       7, 132 Oct 17 10:51 vcsa4
    crw-rw---- 1 root tty       7, 133 Oct 17 10:51 vcsa5
    crw-rw---- 1 root tty       7, 134 Oct 17 10:51 vcsa6
    drwxr-xr-x 2 root root          60 Oct 17 10:51 vfio
    crw------- 1 root root     10,  63 Oct 17 10:51 vga_arbiter
    crw------- 1 root root     10, 137 Oct 17 10:51 vhci
    crw------- 1 root root     10, 238 Oct 17 10:51 vhost-net
    crw------- 1 root root     10,  58 Oct 17 10:51 vmci
    crw------- 1 root root     10,  56 Oct 17 10:51 vsock
    crw-rw-rw- 1 root root      1,   5 Oct 17 10:51 zero
    [root@localhost dev]# 
    View Code

    4、/etc

    二进制安装包(yum、rpm)的配置文件默认路径以及服务启动命令(yum、rpm)存放的目录(/etc/init.d)。

    5、/home

    普通用户家目录默认数据存储目录。

    [root@localhost home]# ls
    bright  test
    View Code

    6、/lib

    库文件存放目录。

    [root@localhost lib]# ll
    total 32
    drwxr-xr-x.  2 root root     6 Nov  7  2016 binfmt.d
    drwxr-xr-x.  3 root root    64 Nov  5  2016 debug
    drwxr-xr-x.  4 root root   236 Oct  1 14:29 dracut
    drwxr-xr-x.  7 root root    83 Oct  1 14:29 firewalld
    drwxr-xr-x. 77 root root 12288 Oct  1 14:30 firmware
    dr-xr-xr-x.  2 root root     6 Nov  5  2016 games
    drwxr-xr-x.  3 root root    21 Oct  1 14:29 grub
    drwxr-xr-x.  6 root root    76 Oct  1 14:29 kbd
    drwxr-xr-x.  2 root root    56 Oct  1 14:29 kdump
    drwxr-xr-x.  3 root root    23 Nov  7  2016 kernel
    drwxr-xr-x.  2 root root    55 Oct  1 14:27 locale
    drwxr-xr-x.  2 root root   111 Oct  1 14:29 modprobe.d
    drwxr-xr-x.  3 root root    35 Oct  1 14:29 modules
    drwxr-xr-x.  2 root root     6 Nov  7  2016 modules-load.d
    drwxr-xr-x.  4 root root    31 Oct  1 14:29 NetworkManager
    drwxr-xr-x.  2 root root    50 Oct  1 14:29 polkit-1
    drwxr-xr-x.  3 root root    27 Oct  1 14:28 python2.7
    drwxr-xr-x.  4 root root  4096 Oct  1 14:28 rpm
    lrwxrwxrwx.  1 root root    30 Oct  1 14:30 sendmail -> /etc/alternatives/mta-sendmail
    lrwxrwxrwx.  1 root root    24 Oct  1 14:30 sendmail.postfix -> ../sbin/sendmail.postfix
    dr-xr-xr-x.  2 root root     6 Nov  5  2016 sse2
    drwxr-xr-x.  2 root root    51 Oct  1 14:29 sysctl.d
    drwxr-xr-x. 12 root root  4096 Oct  1 14:29 systemd
    drwxr-xr-x.  2 root root  4096 Oct  1 14:30 tmpfiles.d
    drwxr-xr-x. 11 root root   240 Oct  1 14:30 tuned
    drwxr-xr-x.  4 root root   226 Oct  1 14:29 udev
    drwxr-xr-x.  2 root root    80 Nov 15  2016 yum-plugins
    [root@localhost lib]# 
    View Code

    7、/mnt

    用于临时挂载存储的挂载目录,比如cdron、u盘等需要插入后挂载才能使用。

    8、/opt

    option可选择的意思。有些软件,比如自定义的软件包、自己编译的软件包、源码安装的软件包可以安装在这个目录。视个人习惯而定。

    9、/proc

    操作系统运行时,进程及内核信息(比如cpu、内存信息等)存放在这里。 

    10、/root

    超级用户root家目录。

    11、/sbin

    大多数系统管理命令的存放处,是超级用户root可执行命令存放的地方,该目录与/usr/sbin类似。

    12、/tmp

    临时文件存放的目录。用户运行程序时,产生的临时文件就存放于此,权限比较特殊。/var/tmp目录与之类似。

    13、/usr

    系统存放程序的目录,比如命令、帮助文件等。Linux发行版官方提供的软件包,大多安装在此处。

    14、/var

    Variable Data这个目录是经常变动的,/var目录下/var/log是用来放系统日志文件(/var/log/messages)的目录。

    根目录下有很多的目录,其中日常中使用较多的目录包括:

    • /dev 设备目录
    • /etc 配置文件以及服务启动目录
    • /proc 内核及进程信息虚拟化文件系统
    • /tmp 临时文件目录
    • /home 普通用户家目录
    • /var 一般是日志文件存储的目录
    • /usr 用户程序及数据、帮助文件等目录
    • /bin /sbin /usr/bin 用户命令目录 

    三、"/usr" & “/var”目录结构

    "/usr" 和 “/var”是FHS第二层的目录规范。

    (一)/usr目录结构

    路径 说明
    /usr/sbin 可执行程序的目录,大多涉及系统管理的命令
    /usr/bin 可执行的二进制文件目录
    /usr/local 用户自编译安装软件的粗放目录,一般是通过源码包安装的软件,如果在没有指定安装目录的情况下,一般是安装在这个目录下。相当于windows系统下的 c:Program files
    /usr/share 系统共用的的东西,比如/usr/share/man帮助文档
    /usr/src 内核源码存放目录
    /usr/lib 系统使用到的函数库
    /usr/local/sbin 系统全局环境目录,放置一些不需要加路径执行的脚本等
    /usr/local/bin 用户安装的小的应用程序以及一些在/usr/local目录下大应用程序的符号连接
    /usr/local/lib 系统使用到的函数库

    (二)/var目录结构

    路径 说明
     /var/log  各种系统日志存放目录
    /var/log/messages 系统信息默认存放日志处
     /var/log/secure  记录登入系统存取信息的文件,例如ssh,ftp都会记录于此。属于系统安全的日志文件
    /var/log/wtmp 记录登录这信息的文件
    /var/spool 定时任务crontab默认文件,按用户名命名的文件
    /var/spool/mail 系统用户邮件存放目录

    四、重要子目录结构 

    (一)/etc子目录

    • /etc/sysconfig/network-scripts/ifcfg-ens33

    配置网络地址等信息,配置完成后是使网卡生效通过/etc/init.d/network restart(针对的是所有网卡)。

    • /etc/resolv.conf

    设置Linux本地客户端DNS文件,该文件实现域名和ip的互相解析。

    • /etc/sysconfig/network

    修改机器名、网卡启动、网关等信息的配置文件

    • /etc/hosts

    设定用户ip与域名对应解析表

    • /etc/re.local

    存放开机自启动程序命令的文件,它与chkconfig的区别是chkconfig只能管理yum/rpm安装程序的启动服务。

    • /etc/fstab

    记录开机要挂载(mount)的文件系统的一个文件

    • /etc/inittab

    设定系统启动时init进程将系统设置成什么样的runlevel以及加载相关的启动文件设置

    • /etc/exports

    设定NFS网络文件系统用的配置文件

    • /etc/init.d

    存放系统服务启动的脚本文件

    • /etc/profile

    系统全局环境变量路径配置文件

    • /etc/profile.d

    加载系统登陆程序的一个目录、命令、文件独立存在

    • /etc/issue

    记录用户登陆前显示的信息

    • /etc/motd

    登录提醒信息

    [root@localhost profile.d]# echo "Welcome Linux!" > /etc/motd
    [root@localhost profile.d]# cat /etc/motd 
    Welcome Linux!
    View Code
    •  /etc/redhat-release

    名称和版本的信息

    [root@localhost profile.d]# cat /etc/redhat-release 
    CentOS Linux release 7.3.1611 (Core) 
    [root@localhost profile.d]# uname -r
    3.10.0-514.el7.x86_64
    [root@localhost profile.d]# uname -m
    x86_64
    [root@localhost profile.d]# uname -a
    Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    View Code
    • /etc/group

    设定用户的组名及相关信息

    • /etc/passwd

    账号信息文件

    • /etc/shadow

    密码信息文件

    • /etc/sudoers

    sudo命令配置文件(普通用户权限提升)

    • /etc/securetty

    设定那些终端可以让root用户登录

    • /etc/login.defs

    所有用户登录时的缺省配置

    • /etc/modprobe.conf

    内核模块额外参数设定

    (二)/lib子目录

    • /lib/modules

    kernel相关模块

    (三)/proc子目录

    • /proc/version

    内核版本

    [root@localhost /]# cat /proc/version 
    Linux version 3.10.0-514.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Tue Nov 22 16:42:41 UTC 2016
    View Code
    • /proc/sys/kernel

    内核功能

    [root@localhost /]# ll /proc/sys/kernel/
    total 0
    -rw-r--r-- 1 root root 0 Oct 18 11:55 acct
    -rw-r--r-- 1 root root 0 Oct 18 11:55 acpi_video_flags
    -rw-r--r-- 1 root root 0 Oct 18 11:55 auto_msgmni
    -r--r--r-- 1 root root 0 Oct 18 11:55 bootloader_type
    -r--r--r-- 1 root root 0 Oct 18 11:55 bootloader_version
    -rw------- 1 root root 0 Oct 18 11:55 cad_pid
    -r--r--r-- 1 root root 0 Oct 18 10:31 cap_last_cap
    -rw-r--r-- 1 root root 0 Oct 18 11:55 compat-log
    -rw-r--r-- 1 root root 0 Oct 18 11:55 core_pattern
    -rw-r--r-- 1 root root 0 Oct 18 11:55 core_pipe_limit
    -rw-r--r-- 1 root root 0 Oct 18 10:31 core_uses_pid
    -rw-r--r-- 1 root root 0 Oct 18 11:55 ctrl-alt-del
    -rw-r--r-- 1 root root 0 Oct 18 11:55 dmesg_restrict
    -rw-r--r-- 1 root root 0 Oct 18 11:55 domainname
    -rw-r--r-- 1 root root 0 Oct 18 11:55 ftrace_dump_on_oops
    -rw-r--r-- 1 root root 0 Oct 18 11:55 ftrace_enabled
    -rw-r--r-- 1 root root 0 Oct 18 11:55 hardlockup_all_cpu_backtrace
    -rw-r--r-- 1 root root 0 Oct 18 11:55 hardlockup_panic
    -rw-r--r-- 1 root root 0 Oct 18 10:31 hostname
    -rw-r--r-- 1 root root 0 Oct 18 11:55 hotplug
    -rw-r--r-- 1 root root 0 Oct 18 11:55 hung_task_check_count
    -rw-r--r-- 1 root root 0 Oct 18 11:55 hung_task_panic
    -rw-r--r-- 1 root root 0 Oct 18 11:55 hung_task_timeout_secs
    -rw-r--r-- 1 root root 0 Oct 18 11:55 hung_task_warnings
    -rw-r--r-- 1 root root 0 Oct 18 11:55 io_delay_type
    -rw-r--r-- 1 root root 0 Oct 18 11:55 kexec_load_disabled
    dr-xr-xr-x 1 root root 0 Oct 18 11:55 keys
    -rw-r--r-- 1 root root 0 Oct 18 11:55 kptr_restrict
    -rw-r--r-- 1 root root 0 Oct 18 11:55 kstack_depth_to_print
    -rw-r--r-- 1 root root 0 Oct 18 11:55 max_lock_depth
    -rw-r--r-- 1 root root 0 Oct 18 11:55 modprobe
    -rw-r--r-- 1 root root 0 Oct 18 11:55 modules_disabled
    -rw-r--r-- 1 root root 0 Oct 18 11:55 msgmax
    -rw-r--r-- 1 root root 0 Oct 18 11:55 msgmnb
    -rw-r--r-- 1 root root 0 Oct 18 11:55 msgmni
    -rw-r--r-- 1 root root 0 Oct 18 11:55 msg_next_id
    -r--r--r-- 1 root root 0 Oct 18 10:31 ngroups_max
    -rw-r--r-- 1 root root 0 Oct 18 11:55 nmi_watchdog
    -rw-rw-rw- 1 root root 0 Oct 18 11:55 ns_last_pid
    -rw-r--r-- 1 root root 0 Oct 18 11:55 numa_balancing
    -rw-r--r-- 1 root root 0 Oct 18 11:55 numa_balancing_scan_delay_ms
    -rw-r--r-- 1 root root 0 Oct 18 11:55 numa_balancing_scan_period_max_ms
    -rw-r--r-- 1 root root 0 Oct 18 11:55 numa_balancing_scan_period_min_ms
    -rw-r--r-- 1 root root 0 Oct 18 11:55 numa_balancing_scan_size_mb
    -rw-r--r-- 1 root root 0 Oct 18 11:55 numa_balancing_settle_count
    -r--r--r-- 1 root root 0 Oct 18 11:55 osrelease
    -r--r--r-- 1 root root 0 Oct 18 11:55 ostype
    -rw-r--r-- 1 root root 0 Oct 18 11:55 overflowgid
    -rw-r--r-- 1 root root 0 Oct 18 11:55 overflowuid
    -rw-r--r-- 1 root root 0 Oct 18 11:55 panic
    -rw-r--r-- 1 root root 0 Oct 18 11:55 panic_on_io_nmi
    -rw-r--r-- 1 root root 0 Oct 18 11:55 panic_on_oops
    -rw-r--r-- 1 root root 0 Oct 18 11:55 panic_on_stackoverflow
    -rw-r--r-- 1 root root 0 Oct 18 11:55 panic_on_unrecovered_nmi
    -rw-r--r-- 1 root root 0 Oct 18 11:55 panic_on_warn
    -rw-r--r-- 1 root root 0 Oct 18 11:55 perf_cpu_time_max_percent
    -rw-r--r-- 1 root root 0 Oct 18 11:55 perf_event_max_sample_rate
    -rw-r--r-- 1 root root 0 Oct 18 11:55 perf_event_mlock_kb
    -rw-r--r-- 1 root root 0 Oct 18 11:55 perf_event_paranoid
    -rw-r--r-- 1 root root 0 Oct 18 11:55 pid_max
    -rw-r--r-- 1 root root 0 Oct 18 11:55 poweroff_cmd
    -rw-r--r-- 1 root root 0 Oct 18 11:55 print-fatal-signals
    -rw-r--r-- 1 root root 0 Oct 18 11:55 printk
    -rw-r--r-- 1 root root 0 Oct 18 11:55 printk_delay
    -rw-r--r-- 1 root root 0 Oct 18 11:55 printk_ratelimit
    -rw-r--r-- 1 root root 0 Oct 18 11:55 printk_ratelimit_burst
    dr-xr-xr-x 1 root root 0 Oct 18 10:40 pty
    dr-xr-xr-x 1 root root 0 Oct 18 10:31 random
    -rw-r--r-- 1 root root 0 Oct 18 11:55 randomize_va_space
    -rw-r--r-- 1 root root 0 Oct 18 11:55 real-root-dev
    -rw-r--r-- 1 root root 0 Oct 18 11:55 sched_autogroup_enabled
    -rw-r--r-- 1 root root 0 Oct 18 11:55 sched_cfs_bandwidth_slice_us
    -rw-r--r-- 1 root root 0 Oct 18 11:55 sched_child_runs_first
    dr-xr-xr-x 1 root root 0 Oct 18 11:55 sched_domain
    -rw-r--r-- 1 root root 0 Oct 18 11:55 sched_latency_ns
    -rw-r--r-- 1 root root 0 Oct 18 11:55 sched_migration_cost_ns
    -rw-r--r-- 1 root root 0 Oct 18 10:31 sched_min_granularity_ns
    -rw-r--r-- 1 root root 0 Oct 18 11:55 sched_nr_migrate
    -rw-r--r-- 1 root root 0 Oct 18 11:55 sched_rr_timeslice_ms
    -rw-r--r-- 1 root root 0 Oct 18 11:55 sched_rt_period_us
    -rw-r--r-- 1 root root 0 Oct 18 11:55 sched_rt_runtime_us
    -rw-r--r-- 1 root root 0 Oct 18 11:55 sched_schedstats
    -rw-r--r-- 1 root root 0 Oct 18 11:55 sched_shares_window_ns
    -rw-r--r-- 1 root root 0 Oct 18 11:55 sched_time_avg_ms
    -rw-r--r-- 1 root root 0 Oct 18 11:55 sched_tunable_scaling
    -rw-r--r-- 1 root root 0 Oct 18 10:31 sched_wakeup_granularity_ns
    -rw-r--r-- 1 root root 0 Oct 18 11:55 sem
    -rw-r--r-- 1 root root 0 Oct 18 11:55 sem_next_id
    -rw-r--r-- 1 root root 0 Oct 18 11:55 shmall
    -rw-r--r-- 1 root root 0 Oct 18 11:55 shmmax
    -rw-r--r-- 1 root root 0 Oct 18 11:55 shmmni
    -rw-r--r-- 1 root root 0 Oct 18 11:55 shm_next_id
    -rw-r--r-- 1 root root 0 Oct 18 11:55 shm_rmid_forced
    -rw-r--r-- 1 root root 0 Oct 18 11:55 softlockup_all_cpu_backtrace
    -rw-r--r-- 1 root root 0 Oct 18 11:55 softlockup_panic
    -rw-r--r-- 1 root root 0 Oct 18 11:55 stack_tracer_enabled
    -rw-r--r-- 1 root root 0 Oct 18 10:31 sysrq
    -rw-r--r-- 1 root root 0 Oct 18 11:55 tainted
    -rw-r--r-- 1 root root 0 Oct 18 11:55 threads-max
    -rw-r--r-- 1 root root 0 Oct 18 11:55 timer_migration
    -rw-r--r-- 1 root root 0 Oct 18 11:55 traceoff_on_warning
    -rw-r--r-- 1 root root 0 Oct 18 11:55 unknown_nmi_panic
    dr-xr-xr-x 1 root root 0 Oct 18 11:55 usermodehelper
    -r--r--r-- 1 root root 0 Oct 18 11:55 version
    -rw-r--r-- 1 root root 0 Oct 18 11:55 watchdog
    -rw-r--r-- 1 root root 0 Oct 18 11:55 watchdog_cpumask
    -rw-r--r-- 1 root root 0 Oct 18 11:55 watchdog_thresh
    View Code
    • /proc/cpuinfo

    处理器信息,例如类型、厂家、型号等信息

    [root@localhost /]# cat /proc/cpuinfo 
    processor    : 0
    vendor_id    : GenuineIntel
    cpu family    : 6
    model        : 61
    model name    : Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz
    stepping    : 4
    microcode    : 0x18
    cpu MHz        : 2194.298
    cache size    : 3072 KB
    physical id    : 0
    siblings    : 1
    core id        : 0
    cpu cores    : 1
    apicid        : 0
    initial apicid    : 0
    fpu        : yes
    fpu_exception    : yes
    cpuid level    : 20
    wp        : yes
    flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch ida arat epb pln pts dtherm fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap xsaveopt
    bogomips    : 4389.96
    clflush size    : 64
    cache_alignment    : 64
    address sizes    : 42 bits physical, 48 bits virtual
    power management:
    View Code
    • /proc/meminfo

    系统内存信息

    [root@localhost /]# cat /proc/meminfo 
    MemTotal:        1867264 kB
    MemFree:         1616368 kB
    MemAvailable:    1601052 kB
    Buffers:             876 kB
    Cached:           107460 kB
    SwapCached:            0 kB
    Active:            81700 kB
    Inactive:          72628 kB
    Active(anon):      46340 kB
    Inactive(anon):     8404 kB
    Active(file):      35360 kB
    Inactive(file):    64224 kB
    Unevictable:           0 kB
    Mlocked:               0 kB
    SwapTotal:       2097148 kB
    SwapFree:        2097148 kB
    Dirty:                 0 kB
    Writeback:             0 kB
    AnonPages:         46012 kB
    Mapped:            23580 kB
    Shmem:              8752 kB
    Slab:              41116 kB
    SReclaimable:      19380 kB
    SUnreclaim:        21736 kB
    KernelStack:        3664 kB
    PageTables:         3268 kB
    NFS_Unstable:          0 kB
    Bounce:                0 kB
    WritebackTmp:          0 kB
    CommitLimit:     3030780 kB
    Committed_AS:     253140 kB
    VmallocTotal:   34359738367 kB
    VmallocUsed:      179176 kB
    VmallocChunk:   34359310332 kB
    HardwareCorrupted:     0 kB
    AnonHugePages:      6144 kB
    HugePages_Total:       0
    HugePages_Free:        0
    HugePages_Rsvd:        0
    HugePages_Surp:        0
    Hugepagesize:       2048 kB
    DirectMap4k:       59264 kB
    DirectMap2M:     2037760 kB
    DirectMap1G:           0 kB
    View Code
    • /proc/device

    当前内核运行的所有配置的设备清单

    [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
      7 vcs
     10 misc
     13 input
     14 sound
     21 sg
     29 fb
     99 ppdev
    116 alsa
    128 ptm
    136 pts
    162 raw
    180 usb
    188 ttyUSB
    189 usb_device
    202 cpu/msr
    203 cpu/cpuid
    226 drm
    247 dimmctl
    248 ndctl
    249 hidraw
    250 usbmon
    251 bsg
    252 watchdog
    253 rtc
    254 tpm
    
    Block devices:
    259 blkext
      8 sd
      9 md
     11 sr
     65 sd
     66 sd
     67 sd
     68 sd
     69 sd
     70 sd
     71 sd
    128 sd
    129 sd
    130 sd
    131 sd
    132 sd
    133 sd
    134 sd
    135 sd
    254 mdp
    View Code
    • /proc/dma

    当前正在使用的DMA通道

    • /proc/filesystems

    当前运行内核所配置的文件系统

    • /proc/interrupts

    正在使用的中断已经曾经有多少个中断

    • /proc/ioports

    当前正在使用的I/O端口

    • /proc/loadavvg

    系统负载平均值信息,uptime命令的结果。

  • 相关阅读:
    web前端开发(4)
    web前端开发(3)
    web前端开发(2)
    【计算机算法设计与分析】——SVM
    【计算机算法与分析】——7.1分枝-限界法
    【模式识别与机器学习】——判别式和产生式模型
    【模式识别与机器学习】——logistic regression
    【模式识别与机器学习】——最小二乘回归
    【模式识别与机器学习】——似然函数
    【计算机算法设计与分析】——6.4图的着色
  • 原文地址:https://www.cnblogs.com/shenjianping/p/13830292.html
Copyright © 2011-2022 走看看