I know you can use "touch" to change the access and modify timestamps of a file using the "-t" flag but is it possible to change the "change" timestamp. If so how would I go about doing this? Thanks so much for your time.
Asked
Active
Viewed 2,668 times
1 Answers
8
You're asking how to set the ctime value of a file. The only way to do that is to change the system date and then change the file, which is quite a crude method that will probably cause harm to the rest of your system.
If you're using ext3 (maybe ext2 and ext4 also?) you can use debugfs to change it, but that requires that you unmount the filesystem first. You can find info at COMMAND LINE KUNG FU: Episode #80: Time Bandits (the start is about Windows; skip about halfway down to "Hal has the touch") to read about commands like this: debugfs -w -R 'set_inode_field /tmp/test ctime 200901010101' /dev/mapper/elk-root
Without using filesystem metadata hackery like that, you can't do it.
Emmaly
- 181