linux-tutorial/codes/shell/基本脚本/通过反引号获得当前日期并生成唯一文件名.sh
2019-10-29 18:22:19 +08:00

7 lines
123 B
Bash

#!/usr/bin/env bash
#copy the /usr/bin directory listing to a log file
today=`date +%y%m%d`
ls /usr/bin -al > log.$today