linux-tutorial/codes/shell/示例脚本/基本脚本/通过反引号获得当前日期并生成唯一文件名.sh

6 lines
114 B
Bash
Raw Normal View History

2019-05-10 11:17:57 +08:00
#!/bin/bash
#copy the /usr/bin directory listing to a log file
today=`date +%y%m%d`
ls /usr/bin -al > log.$today