My cool new Blog

Hello World! This is the most epic subtitle ever.
en de

[筆記] 將日期變數 date variable 加入 bashrc

2015-12-22 未分類

 

vim /etc/bashrc ( or /HOME_DIR/.bashrc)

export datecode=date +"%Y%m%d"

以後就可以直接使用 $datecode 來產生今天的日期給備份的命令用

[root@w ~]# touch test_$datecode [root@w ~]# ls anaconda-ks.cfg ** test_20151222 ** yum.txt [root@w ~]#

comments powered by Disqus