• Post Reply Bookmark Topic Watch Topic
  • New Topic

Touch command  RSS feed

 
Jackie Wang
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically i want to change the last modified date of a file using the touch command. I want to be able to give the date myself.
touch -d OR touch -t options can be of use?
Are there a way that people can track back I have manually change the date?
thanks for your help.
jack
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
touch should do it.
If you choose a date in the future, and users see it before, they might recognize it.
(I only use years to make the examples small
If your file was last modified 2003 and a user sees it. Then you touch it with year 1970. People might remember.
And somebody might run a log-daemon:
2001: foo.txt 2000
2002: foo.txt 2000
2003: foo.txt 2001 <- suspicious
2004: foo.txt 1999 <- suspicious
But I think there is no way in finding out a secret-real-date.
There are inodes - which correspondent in some way to the physical adresses where a file is.
And other unixes have ctime, atime, mtime - creation, access, and modification. But as far as I know linux doesn't support them, on no filesystem - but check this out.
I'm not sure about the inodes, but I guess if you move a file from here to there and back again, the inode-time is updated, but the mtime is not. Therefore a inconsistency is not a proof for a manipulation, but might indicate one.
I wouldn't trust any file-date, if I got reason to be sceptic.
A file, older than its folder might indicate a manipulation too, but is no proof.
 
Jackie Wang
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Stefan,
So if I just want to change the update timestamp for that file.
Should I just do.
touch -f <filename>
Because the man page is not really clear and intuitive.
How can I specifically change to something like
-rw-r--r-- 1 pquartz 3680 Jan 30 20:21 3.txt
thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!