date获取系统时间,"+%Y_%m_%d_%H_%M_%S"指定格式,$time 输出时间, ~/Desktop/ $newFile指定位置下的文件夹
python
#!/bin/bash
time=$(date "+%Y_%m_%d_%H_%M_%S")
newFile=$time".log"
echo $time > ~/Desktop/$newFile