bash特性之命令行展开功能应用示例
-
1.创建/tmp的目录下:a_c,a_d,b_c,b_d
- 创建命令:mkdir -pv /tmp/{a,b}_{c_d}
-
操作:
[root@localhost tmp]# mkdir -pv /tmp/{a,b}_{c,d} mkdir: created directory ‘/tmp/a_c’ mkdir: created directory ‘/tmp/a_d’ mkdir: created directory ‘/tmp/b_c’ mkdir: created directory ‘/tmp/b_d’
-
验证:
[root@localhost tmp]# tree /tmp/ /tmp/ ├── a_c ├── a_d ├── b_c ├── b_d
-
2.在/tmp/mylinux目录下的创建根文件系统的目录、boot目录等
- 创建命令:mkdir -pv /tmp/mylinux/{bin,boot/grub,dev,etc/{rc.d/init.d,sysconfig/network-scripts},lib/modules,lib64,proc,sbin,sys,tmp,usr/local/{bin,sbin},var/{lock,log,run}}
-
操作:
[root@localhost tmp]# mkdir -pv /tmp/mylinux/{bin,boot/grub,dev,etc/{rc.d/init.d,sysconfig/network-scripts},lib/modules,lib64,proc,sbin,sys,tmp,usr/local/{bin,sbin},var/{lock,log,run}} mkdir: created directory ‘/tmp/mylinux’ mkdir: created directory ‘/tmp/mylinux/bin’ mkdir: created directory ‘/tmp/mylinux/boot’ mkdir: created directory ‘/tmp/mylinux/boot/grub’ mkdir: created directory ‘/tmp/mylinux/dev’ mkdir: created directory ‘/tmp/mylinux/etc’ mkdir: created directory ‘/tmp/mylinux/etc/rc.d’ mkdir: created directory ‘/tmp/mylinux/etc/rc.d/init.d’ mkdir: created directory ‘/tmp/mylinux/etc/sysconfig’ mkdir: created directory ‘/tmp/mylinux/etc/sysconfig/network-scripts’ mkdir: created directory ‘/tmp/mylinux/lib’ mkdir: created directory ‘/tmp/mylinux/lib/modules’ mkdir: created directory ‘/tmp/mylinux/lib64’ mkdir: created directory ‘/tmp/mylinux/proc’ mkdir: created directory ‘/tmp/mylinux/sbin’ mkdir: created directory ‘/tmp/mylinux/sys’ mkdir: created directory ‘/tmp/mylinux/tmp’ mkdir: created directory ‘/tmp/mylinux/usr’ mkdir: created directory ‘/tmp/mylinux/usr/local’ mkdir: created directory ‘/tmp/mylinux/usr/local/bin’ mkdir: created directory ‘/tmp/mylinux/usr/local/sbin’ mkdir: created directory ‘/tmp/mylinux/var’ mkdir: created directory ‘/tmp/mylinux/var/lock’ mkdir: created directory ‘/tmp/mylinux/var/log’ mkdir: created directory ‘/tmp/mylinux/var/run’
-
验证:
[root@localhost tmp]# tree /tmp/mylinux/ /tmp/mylinux/ ├── bin ├── boot │ └── grub ├── dev ├── etc │ ├── rc.d │ │ └── init.d │ └── sysconfig │ └── network-scripts ├── lib │ └── modules ├── lib64 ├── proc ├── sbin ├── sys ├── tmp ├── usr │ └── local │ ├── bin │ └── sbin └── var ├── lock ├── log └── run
原创文章,作者:N27_xiaoni,如若转载,请注明出处:http://www.178linux.com/79492
评论列表(1条)
总结的非常好的,希望您能牢记这些基础知识,加油!!!