1. 新建文件:  如果文件不存在,则新建, 若存在,则改变文件时间戳,不改变文件内容。

    touch a.txt | date "+%Y - %m - %d  %k : %M : %S" >> a.txt    ##创建文件a.txt, 并获取系统当前时间以"%Y - %m - %d  %k : %M : %S"格式追加到a.txt中。

     

  2. 修改文件时间戳

    https://blog.51cto.com/lsbhjshyn/1774703