linux - 为什么 cp -p 不保留 ctime
问题描述
为什么 cp -p 不保留 ctime?
我认为所有时间戳都应该按照描述保留
--preserve[=ATTR_LIST]
preserve the specified attributes (default: mode,ownership,timestamps), if possible additional attributes: context, links, xattr, all
[root@node101 test]# stat 1
File: ‘1’
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd00h/64768d Inode: 54395143 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2019-08-08 11:00:04.207486784 +0800
Modify: 2019-08-08 11:00:04.207486784 +0800
Change: 2019-08-08 11:00:04.207486784 +0800
Birth: -
[root@node101 test]# cp -p 1 2
[root@node101 test]# stat 2
File: ‘2’
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd00h/64768d Inode: 54395144 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2019-08-08 11:00:04.207486784 +0800
Modify: 2019-08-08 11:00:04.207486784 +0800
Change: 2019-08-08 11:00:28.478788113 +0800
Birth: -
解决方案
推荐阅读
- android - 保存和使用 New Relic API 密钥的正确方法
- javascript - 仅允许 4 个域访问另一个站点上的某些内容
- java - Gson:将双精度值格式化为小数点后 4 位
- html - 为什么 ReactJs htmlFor 不隐藏输入字段
- javascript - Chrome 扩展程序循环打开一个面板,不会停止
- json - 在 Power BI/M 中按名称而不是数字展开 JSON 字段
- excel - 如何为 MSForms.ListBox VBA 定制 MultiSelect?
- scala - 测试弃用的Scala函数时如何抑制弃用警告?
- node.js - webpack / npm 设置动态组件加载
- r - 如何在 Shiny R 中保存编辑