当前位置:首页 > 操作系统 > Linux

linux 从入门到跑路

linux 从入门到跑路

text0 ls,cp,mkdir命令练习

1、显示/etc/目录下以非字母开头,后面跟了一个字母及其它任意长度任意字符的文件或目录

[root@localhost test]# touch 1a24d564fd ^s2124545 afsdf4s5d42 *02645

[root@localhost test]# ls

*02645 1a24d564fd afsdf4s5d42 ^s2124545

[root@localhost test]# ls [^[:alpha:]][[:alpha:]]*

1a24d564fd ^s2124545

2、显示/etc/目录下所有以rc开头,并后面是0-6之间的数字,其它为任意字符的文件或目录

[root@localhost test]# touch rc1sdasd rc2sdsfs rc88 rcrwrw asdasd

[root@localhost test]# ls

asdasd rc1sdasd rc2sdsfs rc88 rcrwrw

[root@localhost test]# ls rc[0-6]*

rc1sdasd rc2sdsfs

3、显示/etc目录下,所有以.d结尾的文件或目录

[root@localhost test]# touch dasd.d eqwe.f hrthy 215645 2sd2134 ds21456f.d

[root@localhost test]# ls

215645 2sd2134 dasd.d ds21456f.d eqwe.f hrthy

[root@localhost test]# ls *.d

dasd.d ds21456f.d

4、显示/etc目录下,所有.conf结尾,且以m,n,r,p开头的文件或目录

[root@localhost test]# touch m2e2.conf ngesd.conf rsds.conf pdfgds.conf 2123.conf asdas.conf

[root@localhost test]# ls

2123.conf asdas.conf m2e2.conf ngesd.conf pdfgds.conf rsds.conf

[root@localhost test]# ls [mnrp]*.conf

m2e2.conf ngesd.conf pdfgds.conf rsds.conf

原文:https://www.cnblogs.com/FrancisDrakeK/p/9308866.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!