Moo*_*oon 10 directory timestamps mv
我想将目录从一个位置移动到另一个位置,但是当我这样做时,我可以看到时间戳已更改。有没有办法将时间戳保留为原始时间戳?
查看了手册页,mv
但找不到任何现有选项。
αғs*_*нιη 11
cp
如下使用,mv
不行。
cp -r -p /path/to/sourceDirectory /path/to/destination/
Run Code Online (Sandbox Code Playgroud)
来自人cp:
-p
same as --preserve=mode,ownership,timestamps
--preserve[=ATTR_LIST]
preserve the specified attributes (default: mode,ownership,timestamps), if possible additional attributes: context, links, xattr, all
Run Code Online (Sandbox Code Playgroud)
然后复制完成后,删除 sourceDirectory。