Hello,
I had to recover some fotos that have been erased from my archive by error . However, now these files present the date they were recovered, not the creation date when fotos were taken.
I want to change date to creation date in linux, not going to buy some software to do it on windows .
Any suggestions will be appreciated.
Thanks.
How to change file date to creation date ?
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
How to change file date to creation date ?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: How to change file date to creation date ?
If you used the cp command the -a option preserves the original time, same as rsync with the -a option.
Whatever you used, you didn't specify, should have an option to preserve the date/time of the original file.
Whatever you used, you didn't specify, should have an option to preserve the date/time of the original file.
Re: How to change file date to creation date ?
One way is to pack file(s) and unpack the package.
Re: How to change file date to creation date ?
Hi WharfRat,
I have my archive mirrored in pCloud. I recovered my files from pCloud's trash folder but there's no option to set the original file date.
But I can see the creation date in the file's properties, so this information is not lost and it can be restored.
Thanks
I have my archive mirrored in pCloud. I recovered my files from pCloud's trash folder but there's no option to set the original file date.
But I can see the creation date in the file's properties, so this information is not lost and it can be restored.
Thanks
Re: How to change file date to creation date ?
Install exiftool
Code: Select all
apt install libimage-exiftool-perl
Code: Select all
exiftool mökki3.jpg
Re: How to change file date to creation date ?
Right tool, wrong screenshot (that's the file date). Using exiftool, for all .jpg files in a folder this will set all file dates to their creation date as per their exif tag, if any:administrollaattori wrote: ⤴Wed Oct 17, 2018 12:34 pmInstall exiftoolCheck picture's metadata via Terminal likeCode: Select all
apt install libimage-exiftool-perl
mökki3.pngCode: Select all
exiftool mökki3.jpg
http://xahlee.info/img/metadata_in_image_files.html
Code: Select all
for F in *.jpg;do exiftool -createdate -d "%Y-%m-%d %H:%M:%S" "$F"|awk -F': ' '{print $2}'|xargs -r touch $F -d;done
Re: How to change file date to creation date ?
New users are often surprised to discover that Linux/Unix file systems do not support file creation date. They support time of last modification, last access, and last modification of the file's inode and that's it.administrollaattori wrote: ⤴Wed Oct 17, 2018 12:16 pm One way is to pack file(s) and unpack the package.
So packing and unpacking is probably a good way to go about it.
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
Re: How to change file date to creation date ?
And veteran users are often surprised by some of the statements you make (SCNR ). Of course Linux file systems support creation time. Here, for example, for ext4:
https://github.com/torvalds/linux/blob/ ... xt4.h#L750
But as OP already explained, it doesn't matter in this case because he's only got a cloud backup.