linux上生成以当前时间为名称的文件 Home » IDC云服务 » linux上生成以当前时间为名称的文件 linux下生成以当前时间为名称的文件 在linux系统中要想生成以当前时间为名称的文件。创建一个shell脚本,并赋予执行的权限。 #!/bin/sh echo test >> $(date -d "today" +"%Y%m%d-%H%M%S").txt 生成了的以时间为名的txt文件如下: -rw-r--r-- 1 root root 5 09-30 14:03 20110930-140302.txt