创建一个带当前日期和时间为文件名的日志文件

阅读 8

2024-11-01


[root@sre01 shells]# touch $(date +%F).log1
[root@sre01 shells]# touch `date +%F`.log2

[root@sre01 shells]# ll
total 8
-rw-r--r--. 1 root root   0 Oct 20 20:00 2024-10-20.log1
-rw-r--r--. 1 root root   0 Oct 20 20:00 2024-10-20.log2


[root@sre01 shells]# touch $(date +%F-%T).log1
[root@sre01 shells]# ll
total 8
-rw-r--r--. 1 root root   0 Oct 20 20:02 2024-10-20-20:02:23.log1

精彩评论(0)

0 0 举报