linux 正则使用

来源:互联网 发布:域名代理平台 编辑:程序博客网 时间:2024/06/06 00:27

1.rm(ls) :快速删除一些连续的文件(ls和rm一样,这里就是列举了)

[root@node2 test]# ls1  12  13  2  3  4[root@node2 test]# rm -rf 12[root@node2 test]# ls1  13  2  3  4[root@node2 test]# touch 12[root@node2 test]# ls1  12  13  2  3  4[root@node2 test]# rm -rf [12]   只删除了1,2相当于枚举[root@node2 test]# ls12  13  3  4[root@node2 test]# touch 1[root@node2 test]# touch 2[root@node2 test]# ls1  12  13  2  3  4[root@node2 test]# rm -rf {12,[12]}  删除了12,1,2[root@node2 test]# ls13  3  4[root@node2 test]# ls1  12  13  2  3  4[root@node2 test]# rm -rf 1[2-3] 效果和rm -rf 1[23];rm -rf 1[2,3]一样  删除12,13[root@node2 test]# ls1  2  3  4



1 0
原创粉丝点击