0
点赞
收藏
分享

微信扫一扫

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

小龟老师 2024-11-01 阅读 8
Linux运维


[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 条评论