Linux 中的通配符详解及实例
Linux 中的通配符详解及实例
一 通配符
二 实战
[root@localhost ~]# mkdir dy [root@localhost ~]# cd dy [root@localhost dy]# touch dzp dzp2 dzp3 dzp34 dzpcang dzpbols [root@localhost dy]# ls dzp dzp2 dzp3 dzp34 dzpbols dzpcang [root@localhost dy]# la dzp bash: la: command not found... [root@localhost dy]# ls dzp dzp [root@localhost dy]# ls dzp* dzp dzp2 dzp3 dzp34 dzpbols dzpcang [root@localhost dy]# ls dzp? dzp2 dzp3 [root@localhost dy]# ls dzp[0-9] dzp2 dzp3 [root@localhost dy]# ls dzp[0-9][0-9] dzp34 [root@localhost dy]# ls dzp[^0-9] ls: cannot access dzp[^0-9]: No such file or directory [root@localhost dy]# touch dzpa [root@localhost dy]# ls dzp[^0-9] dzpa [root@localhost dy]# ls dzp[^0-9]* dzpa dzpbols dzpcang
三 Bash中的其他特殊符号
四 实战
[root@localhost dy]# echo ls ls [root@localhost dy]# echo dzp dzp [root@localhost dy]# aa=123 [root@localhost dy]# echo $aa 123 [root@localhost dy]# echo '$aa' $aa [root@localhost dy]# echo "$aa" 123 [root@localhost dy]# aa=ls [root@localhost dy]# echo "$aa" ls [root@localhost dy]# aa=`ls` [root@localhost dy]# echo "$aa" dzp dzp2 dzp3 dzp34 dzpa dzpbols dzpcang [root@localhost dy]# bb=$(ls) [root@localhost dy]# echo $bb dzp dzp2 dzp3 dzp34 dzpa dzpbols dzpcang [root@localhost dy]# echo $(date) Sat Jul 15 17:23:31 CST 2017 [root@localhost dy]# echo \$bb $bb
以上就是Linux 中通配符的实例详解,如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
相关推荐
wangzhaotongalex 2020-10-20
LuckyLXG 2020-09-08
xuanlvhaoshao 2020-06-16
Justdoit00 2020-06-08
wozijisunfly 2020-06-01
lishaokang 2020-05-10
citic 2020-05-03
bluetears 2020-04-22
jiedinghui 2020-04-20
hithyc 2020-04-17
SoarFly00 2020-02-19
福叔 2020-02-11
xuanlvhaoshao 2020-02-10
lishaokang 2020-01-25
impress 2019-12-31
Laozizuiku 2019-12-29