cp 花括号备份{}

这个命令个人觉得比较方便。记下来方便下次忘记时使用

[root@Client ~]# ls
43_12.txt  anaconda-ks.cfg  ce.sh
[root@Client ~]# 
[root@Client ~]# cp ce.sh{,.bak}       #备份成.bak模式
[root@Client ~]# ls
43_12.txt  anaconda-ks.cfg  ce.sh  ce.sh.bak
[root@Client ~]# 
[root@Client ~]# cp ce.sh{,-beifen}    #备份成-bak模式
[root@Client ~]# ls
43_12.txt  anaconda-ks.cfg  ce.sh  ce.sh.bak  ce.sh-beifen

 [root@Client ~]# mv ce.sh{,-bak}    #用来重命名
  [root@Client ~]# ls
  43_12.txt anaconda-ks.cfg ce.sh-bak

 

posted on 2020-05-12 16:12  wangzy-Zj  阅读(1108)  评论(0编辑  收藏  举报