码迷,mamicode.com
首页 > 系统相关 > 详细

Linux 目录结构

时间:2018-06-22 16:33:24      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:out   dia   临时   连接   dom   3.1   系统用户   文件的   设备文件   

  Linux 目录结构:
==============================

[root@sambo /]# ls
bin data etc lib media newdir proc run split_dir sys usr
boot dev home lib64 mnt opt root sbin srv tmp var

下图为CentOS 目录结构

技术分享图片

 

bin : 普通用户使用的命令 /bin/ls /bin/date

       bin是Binary的缩写。这个目录存放着最经常使用的命令。

sbin; 管理员使用的命令 /sbin/useradd

           s就是Super User的意思,这里存放的是系统管理员使用的系统管理程序。

示例:

[root@sambo /]# which ls
alias ls=‘ls --color=auto‘
/usr/bin/ls
[root@sambo /]# which useradd
/usr/sbin/useradd

dev;  dev是Device(设备)的缩写。该目录下存放的是Linux的外部设备,在Linux中访问设备的方式和访问文件的方式是相同的。
        设备文件 /dev/sda; /dev/tty ;/dev/zero;/dev/null;/dev/random

[root@sambo /]# ll /dev/sda*
brw-rw---- 1 root disk 8, 0 6月 22 11:32 /dev/sda
brw-rw---- 1 root disk 8, 1 6月 22 11:32 /dev/sda1
brw-rw---- 1 root disk 8, 2 6月 22 11:32 /dev/sda2
brw-rw---- 1 root disk 8, 3 6月 22 11:32 /dev/sda3
[root@sambo /]# tty
/dev/pts/0
[root@sambo /]# ll /dev/zero /dev/null /dev/random
crw-rw-rw- 1 root root 1, 3 6月 22 11:32 /dev/null
crw-rw-rw- 1 root root 1, 8 6月 22 11:32 /dev/random
crw-rw-rw- 1 root root 1, 5 6月 22 11:32 /dev/zero

root root用户的HOME
home 普通用户的家目录所在

proc: 虚拟目录,系统内存的映射,里面包含进程。? 可以通过直接访问这个目录来获取系统信息。

[root@sambo ~]# ls /proc      \\这里面的数字都是进程的PID
1 1181 1222 23 293 441 534 605 
10 1187 1224 24 294 442 547 613 
100 1188 1227 242 295 446 549 636 
1016 1191 1228 243 296 448 553 67
1018 1192 1230 244 297 449 558 7 
1019 1193 1231 245 298 45 560 8 
1020 1194 1233 246 3 453 561 9 
1034 1199 1238 249 31 454 562 
1036 12 13 25 32 455 564 

usr 系统文件,非常重要的目录,相当于C:/Windows
      /usr/local 相当于C:/Program Files
     /usr/bin 普通用户使用的应用程序
     /usr/sbin 管理员使用的应用程序
     /usr/lib 库文件32bit
     /usr/lib64 库文件64bit

[root@sambo ~]# ls /usr
bin games lib libexec sbin src
etc include lib64 local share tmp

boot 存放的系统启动相关的文件,例如kernel,grub(引导装载程式)

         存放的是启动Linux时使用的一些核心文件,包括一些连接文件以及镜像文件。

[root@sambo ~]# ls /boot
config-3.10.0-514.el7.x86_64
grub
grub2
initramfs-0-rescue-0fb0f609aa7e4b72962bd6cb203acfdb.img
initramfs-3.10.0-514.el7.x86_64.img
initramfs-3.10.0-514.el7.x86_64kdump.img
initrd-plymouth.img
symvers-3.10.0-514.el7.x86_64.gz
System.map-3.10.0-514.el7.x86_64
vmlinuz-0-rescue-0fb0f609aa7e4b72962bd6cb203acfdb
vmlinuz-3.10.0-514.el7.x86_64

etc 配置文件

    系统相关的配置文件
    应用程序相关的配置文件


bin      库文件32bit
bin64   库文件 64bit

tmp 临时文件

var 存放的不断扩充且经常修改的目录,包括各种日志文件或者pid文件

在Linux系统中,有几个目录是比较重要的,平时需要注意不要误删除或者随意更改内部文件。
/etc: 上边也提到了,这个是系统中的配置文件,如果你更改了该目录下的某个文件可能会导致系统不能启动。
/bin, /sbin, /usr/bin, /usr/sbin: 这是系统预设的执行文件的放置目录,比如 ls 就是在/bin/ 目录下的。值得提出的是,
/bin, /usr/bin 是给系统用户使用的指令(除root外的通用账户),而/sbin, /usr/sbin 则是给root使用的指令。
/var: 这是一个非常重要的目录,系统上跑了很多程序,那么每个程序都会有相应的日志产生,而这些日志就被记录到这个目录下,具体在/var/log 目录下,另外mail的预设放置也是在这里

 

Linux 目录结构

标签:out   dia   临时   连接   dom   3.1   系统用户   文件的   设备文件   

原文地址:https://www.cnblogs.com/sambo510/p/9213849.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!