如何修改目录日期?

Tom*_*ený 11 directory

在 Windows 中,我习惯于修改目录日期,例如。根据拍摄第一张照片的日期包含照片的目录;然后显示按日期排序的目录列表。在 Ubuntu 中,Krusader 可以通过这种方式显示目录。在我用例如填充目录后,我需要更改目录的日期(“修改日期”)。照片。我应该怎么改?谢谢

Rad*_*anu 11

您可以使用touch带有-t选项的命令。这是来自man touch

NAME
       touch - change file timestamps

SYNOPSIS
       touch [OPTION]... FILE...

DESCRIPTION
       Update  the  access  and modification times of each FILE to the current
       time.
[...]

-t STAMP
              use [[CC]YY]MMDDhhmm[.ss] instead of current time
Run Code Online (Sandbox Code Playgroud)

一个例子:

touch -t 1312031429.30 /path/to/directory
Run Code Online (Sandbox Code Playgroud)

将改变修改日期directory2013-12-03 14:29:30