转载与:Linux 系统目录结构 | 菜鸟教程
文件目录结构由 " / " 起始的树形结构!
FHS(filesystem hierarchy standard),文件系统层次化标准;
一,目录四种交互形态
二,目录结构
/bin
[root@192 ~]# ls /usr/bin |grep -E '^cat$|^chmod$|^mv$|^bash$'
bash
cat
chmod
mv
/boot
[root@192 ~]# ls /boot |grep -E 'grub|vmlinuz'
grub
grub2
vmlinuz-0-rescue-c0dc73705fd44b958694b7f44d6eb95a
vmlinuz-3.10.0-1160.el7.x86_64
/dev
[root@192 ~]# ll /dev/{null,zero,tty,lp*,sd*}
crw-rw----. 1 root lp 6, 0 Feb 27 11:18 /dev/lp0
crw-rw----. 1 root lp 6, 1 Feb 27 11:18 /dev/lp1
crw-rw----. 1 root lp 6, 2 Feb 27 11:18 /dev/lp2
crw-rw----. 1 root lp 6, 3 Feb 27 11:18 /dev/lp3
crw-rw-rw-. 1 root root 1, 3 Feb 27 11:18 /dev/null
brw-rw----. 1 root disk 8, 0 Feb 27 11:18 /dev/sda
brw-rw----. 1 root disk 8, 1 Feb 27 11:18 /dev/sda1
brw-rw----. 1 root disk 8, 2 Feb 27 11:18 /dev/sda2
brw-rw----. 1 root disk 8, 3 Feb 27 11:18 /dev/sda3
crw-rw-rw-. 1 root tty 5, 0 Feb 27 11:18 /dev/tty
crw-rw-rw-. 1 root root 1, 5 Feb 27 11:18 /dev/zero
/etc
[root@192 ~]# ll /etc/{passwd,shadow,group,gshadow}
-rw-r--r--. 1 root root 1001 Feb 22 22:33 /etc/group
----------. 1 root root 801 Feb 22 22:33 /etc/gshadow
-rw-r--r--. 1 root root 2337 Feb 22 22:33 /etc/passwd
----------. 1 root root 1181 Feb 22 22:33 /etc/shadow
/home
[root@192 ~]# ls /home
test wz
/lib
t@192 ~]# ls -d /lib*
/lib /lib64
/lost+found
/media
/mnt
/opt
/proc
/root
/run
/sbin
[root@192 ~]# ll /sbin/{fdisk,fsck,ifconfig,init,mkfs}
-rwxr-xr-x. 1 root root 200496 Oct 1 2020 /sbin/fdisk
-rwxr-xr-x. 1 root root 32888 Oct 1 2020 /sbin/fsck
-rwxr-xr-x. 1 root root 81976 Aug 9 2019 /sbin/ifconfig
lrwxrwxrwx. 1 root root 22 Jan 15 12:37 /sbin/init -> ../lib/systemd/systemd
-rwxr-xr-x. 1 root root 11520 Oct 1 2020 /sbin/mkfs
/srv
/sys
[root@192 ~]# ls -1 /sys
block
bus
class
dev
devices
firmware
fs
hypervisor
kernel
module
power
/tmp
/usr
/bin->/usr/bin:绝大部分用户使用的指令;
/sbin->/usr/sbin:超级用户使用的指令;
/lib->/usr/lib:函数库、目标文件及脚本等;
/usr/include:c/c++的头文件等;
/usr/local:存放自行安装的软件;
/usr/share:存放共享文件,不分硬件架构均可读取的数据,如/usr/share/man;
/usr/src:内核源代码默认放置的位置;
[root@192 ~]# ll /usr
总用量 268
dr-xr-xr-x. 2 root root 49152 Feb 17 23:24 bin
drwxr-xr-x. 2 root root 6 Apr 11 2018 etc
drwxr-xr-x. 2 root root 6 Apr 11 2018 games
drwxr-xr-x. 40 root root 8192 Jan 15 12:39 include
dr-xr-xr-x. 43 root root 4096 Jan 15 12:39 lib
dr-xr-xr-x. 145 root root 81920 Jan 15 12:43 lib64
drwxr-xr-x. 49 root root 12288 Jan 15 12:39 libexec
drwxr-xr-x. 12 root root 131 Jan 15 12:34 local
dr-xr-xr-x. 2 root root 20480 Jan 15 12:40 sbin
drwxr-xr-x. 240 root root 8192 Jan 15 12:40 share
drwxr-xr-x. 4 root root 34 Jan 15 12:34 src
lrwxrwxrwx. 1 root root 10 Jan 15 12:34 tmp -> ../var/tmp
/var
/var/cache:应用程序本身运行过程中产生的一些临时文件;
/var/lib:程序本身运行过程中,需使用到的数据文件存放的目录;
/var/lock:某些装置或文件资源一次只可被一个程序使用,被两个程序使用就会出错,因此需上锁;
/var/log:存放日志文件,如/var/log/messages、/var/log/wtmp等;
/var/spool:存放一些队列数据,被使用后通常会被删除;
[root@192 ~]# ll /var
总用量 24
drwxr-xr-x. 2 root root 19 Jan 15 12:39 account
drwxr-xr-x. 2 root root 6 Apr 11 2018 adm
drwxr-xr-x. 13 root root 159 Jan 15 12:45 cache
drwxr-xr-x. 2 root root 6 Oct 2 2020 crash
drwxr-xr-x. 3 root root 34 Jan 15 12:39 db
drwxr-xr-x. 3 root root 18 Jan 15 12:39 empty
drwxr-xr-x. 2 root root 6 Apr 11 2018 games
drwxr-xr-x. 2 root root 6 Apr 11 2018 gopher
drwxr-xr-x. 3 root root 18 Jan 15 12:36 kerberos
drwxr-xr-x. 60 root root 4096 Jan 15 12:45 lib
drwxr-xr-x. 2 root root 6 Apr 11 2018 local
lrwxrwxrwx. 1 root root 11 Jan 15 12:34 lock -> ../run/lock
drwxr-xr-x. 21 root root 4096 Feb 27 11:18 log
lrwxrwxrwx. 1 root root 10 Jan 15 12:34 mail -> spool/mail
drwxr-xr-x. 2 root root 6 Apr 11 2018 nis
drwxr-xr-x. 2 root root 6 Apr 11 2018 opt
drwxr-xr-x. 2 root root 6 Apr 11 2018 preserve
lrwxrwxrwx. 1 root root 6 Jan 15 12:34 run -> ../run
drwxr-xr-x. 12 root root 140 Jan 15 12:39 spool
drwxr-xr-x. 4 root root 28 Jan 15 12:37 target
drwxrwxrwt. 34 root root 8192 Feb 27 18:36 tmp
drwxr-xr-x. 2 root root 6 Apr 11 2018 yp