10-touch 修改时间/创建文件

目录

touch 文件名

touch -r file1 file2

touch -t 时间 文件名


touch 文件名

  • 当文件名不存在时,创建新文件
  • 文件名已存在,不影响文件内容,仅影响修改时间
    • ​​​​​​​​​​​​​​

touch -r file1 file2

  • 按照file1的时间戳修改file2的时间戳
    • ​​​​​​​

touch -t 时间 文件名

  • 将文件的时间戳修改到指定时间,图中修改到2020-10-1 10:10
  • 仅识别完整的年月日时间输入,没有空格和符号。若非本月,只显示到年月日。
    • ​​​​​​​

猜你喜欢

转载自blog.csdn.net/qq_41940001/article/details/109045780
今日推荐