linux 正则使用

时间:2014-09-22 19:45:23   收藏:0   阅读:195

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

[root@node2 test]# ls
1  12  13  2  3  4
[root@node2 test]# rm -rf 12
[root@node2 test]# ls
1  13  2  3  4
[root@node2 test]# touch 12
[root@node2 test]# ls
1  12  13  2  3  4
[root@node2 test]# rm -rf [12]   只删除了1,2相当于枚举
[root@node2 test]# ls
12  13  3  4
[root@node2 test]# touch 1
[root@node2 test]# touch 2
[root@node2 test]# ls
1  12  13  2  3  4
[root@node2 test]# rm -rf {12,[12]}  删除了12,1,2
[root@node2 test]# ls
13  3  4
[root@node2 test]# ls
1  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]# ls
1  2  3  4




评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!