Linux文件目錄結構實驗
1、創建/tmp目錄下的:a_c, a_d, b_c, b_d
[root@localhost tmp]# mkdir -pv /tmp/{a,b}_{c,d}
mkdir: 已創建目錄 "/tmp/a_c"
mkdir: 已創建目錄 "/tmp/a_d"
mkdir: 已創建目錄 "/tmp/b_c"
mkdir: 已創建目錄 "/tmp/b_d"
註:-p 若無父目錄則自動創建,-v 顯示工作流程,並非屬於必加選項。
2、創建/tmp/mylinux目錄下的:
[root@localhost tmp]# mkdir -pv /mylinux/{bin,boot/grub,dev,etc/{rc.d/init,sysconfig/network-scripts},lib/modules,lib64,proc,sbin,sys,tmp,usr/local/{bin,sbin},var/{lock,log,run}}
\mkdir: 已創建目錄 "/mylinux"
mkdir: 已創建目錄 "/mylinux/bin"
mkdir: 已創建目錄 "/mylinux/boot"
mkdir: 已創建目錄 "/mylinux/boot/grub"
mkdir: 已創建目錄 "/mylinux/dev"
mkdir: 已創建目錄 "/mylinux/etc"
mkdir: 已創建目錄 "/mylinux/etc/rc.d"
mkdir: 已創建目錄 "/mylinux/etc/rc.d/init"
mkdir: 已創建目錄 "/mylinux/etc/sysconfig"
mkdir: 已創建目錄 "/mylinux/etc/sysconfig/network-scripts"
mkdir: 已創建目錄 "/mylinux/lib"
mkdir: 已創建目錄 "/mylinux/lib/modules"
mkdir: 已創建目錄 "/mylinux/lib64"
mkdir: 已創建目錄 "/mylinux/proc"
mkdir: 已創建目錄 "/mylinux/sbin"
mkdir: 已創建目錄 "/mylinux/sys"
mkdir: 已創建目錄 "/mylinux/tmp"
mkdir: 已創建目錄 "/mylinux/usr"
mkdir: 已創建目錄 "/mylinux/usr/local"
mkdir: 已創建目錄 "/mylinux/usr/local/bin"
mkdir: 已創建目錄 "/mylinux/usr/local/sbin"
mkdir: 已創建目錄 "/mylinux/var"
mkdir: 已創建目錄 "/mylinux/var/lock"
mkdir: 已創建目錄 "/mylinux/var/log"
mkdir: 已創建目錄 "/mylinux/var/run"
用tree命令來查看我們當前創建的目錄層級結構
[root@localhost tmp]# tree /mylinux
-bash: tree: command not found
使用yum -y install tree 對tree命令進行安裝
[root@localhost tmp]# yum install -y tree
[root@localhost /]# tree /mylinux
/mylinux
├── bin
├── boot
│ └── grub
├── dev
├── etc
│ ├── rc.d
│ │ └── init
│ └── sysconfig
│ └── network-scripts
├── lib
│ └── modules
├── lib64
├── proc
├── sbin
├── sys
├── tmp
├── usr
│ └── local
│ ├── bin
│ └── sbin
└── var
├── lock
├── log
└── run
24 directories, 0 files
Linux文件目錄結構實驗