# Change timestamp?



## Sunnz (Nov 6, 2006)

What timestamps are kept for files? Creation time, access, modify times??

I am wondering, how do I change these times for a particular file.

What I want to do is to create a new file B, that has the same timestamps as file A... and I don't mind if this needs to be done via the terminal.

Thanks.


----------



## Thank The Cheese (Nov 6, 2006)

Hello Sunnz, 

This may not do exactly what you need, but I found this little app (attached) that allows you to change the created/modified date on a file. Place the app anywhere, then drag and drop the file you want to change the date of on top of the app icon. You should then get a pop up box asking for the new date/time.

Worked for me


----------



## nixgeek (Nov 6, 2006)

I know that in Linux there's a command called "touch" that updates the timestamp to the current date.  I have never checked to see if it exists in OS X.


----------



## barhar (Nov 6, 2006)

'... in Linux ' (derived from UNIX) is '"touch" that updates the timestamp to the current date. I have never checked to see if it exists in OS X.' - launch 'Terminal' ('/Applications/Utilities/' folder), enter 'man touch', and press the <return> key.


----------



## Sunnz (Nov 6, 2006)

Ahh, I always thought touch was only used to create a file!! Cool, I'll tried it!! Thanks!!!


----------



## nixgeek (Nov 7, 2006)

Sunnz said:


> Ahh, I always thought touch was only used to create a file!! Cool, I'll tried it!! Thanks!!!



Touch can create a file (learned about it through the Linux Reality podcast....good even for a long-time user like myself ), but it can also update the timestamp of a file.


----------



## nixgeek (Nov 7, 2006)

barhar said:


> '... in Linux ' (derived from UNIX) is '"touch" that updates the timestamp to the current date. I have never checked to see if it exists in OS X.' - launch 'Terminal' ('/Applications/Utilities/' folder), enter 'man touch', and press the <return> key.



True, I could have done that....I usually do.  I just recently learned about touch though and haven't bothered to check on my Mac since I haven't had the need to use it there.


----------



## Sunnz (Nov 10, 2006)

nixgeek said:


> Touch can create a file (learned about it through the Linux Reality podcast....good even for a long-time user like myself ), but it can also update the timestamp of a file.


Wow thanks for the site? May I ask which ep talks about touch? Shell command one?


----------



## bluedevils (Nov 10, 2006)

touch is more powerful than just updating to the current time.  You can change the timestamp to any date/time you want.


----------



## Sunnz (Nov 10, 2006)

Does anyone know why is it called "touch"?


----------



## bluedevils (Nov 10, 2006)

I had always assumed it is becuase the timestamp is the only change to an existing file is why it got its name.


----------



## nixgeek (Nov 10, 2006)

Sunnz said:


> Wow thanks for the site? May I ask which ep talks about touch? Shell command one?



Ack...I don't remember which one.  It was one of the most recent ones.  It was a listener tip I believe.  You might have to go through them, unfortunately.  Thankfully, all of them are excellent podcasts so they are worth listening through.


----------

