PDA

View Full Version : [ubuntu] change file time and date



Michael Dooley
July 30th, 2009, 01:05 AM
When I am in Windows, I am able to change a variety of file attributes using a nice little program called Properties Plus. Is there a similar program for Ubuntu? In my case, I run 8.04.3 on my main maschine but have other machines running intrepid and jaunty.

What I'd like to be able to do (easily) is to select several files or just one and change its/their creation time, modified time and/or accessed time/date.

Thanks for your time.

lisati
July 30th, 2009, 01:08 AM
Ubuntu has the "touch" command (I've seen Windows versions as well)

For more information, type the following on the command line:
man touch

Michael Dooley
July 30th, 2009, 04:02 PM
Thanks lisati. I should have known that there would be a command line fix for this problem.

Michael Dooley
April 9th, 2012, 05:41 AM
Replying to my own thread...

Does anyone know if there is work being done on a GUI for Ubuntu that would let folks change file attributes and time/date stamps as easily as Properties Plus functions in WinXP? I would bet that something like this has been submitted as an idea. I'm getting tired of typing the time/date stamps using touch and would like to think that a simple GUI is on somebody's mind.

Zill
April 9th, 2012, 11:32 AM
...I'm getting tired of typing the time/date stamps using touch and would like to think that a simple GUI is on somebody's mind.
Just out of interest, why do you want to change the time/date stamps of multiple files? These stamps generally automatically show the correct info and so why would you change this?

If you do have a need to change multiple files then a script might be the way to go.

Michael Dooley
April 9th, 2012, 08:35 PM
Just out of interest, why do you want to change the time/date stamps of multiple files?
I am going through old digital photos and changing time/date stamps on those images that have no exif data. These photos were scanned and saved as .jpegs and to set their date is tedious when I have to re-set hundreds of them one by one. If I could do some of this with batch script, I would. Do you have a suggestion as to where I might find a suitable script that I could modify?

Thanks for your time.

edm1
April 9th, 2012, 08:49 PM
I believe Phatch is able to batch process images and metadata. Its in the repository.

Vaphell
April 9th, 2012, 08:56 PM
general idea would be

for f in *.jpeg; do touch -m -t 200012312359.59 "$f"; done

Depends on situation though. Are they contained to a single dir, do they need to be found first among many other pics, do they need one common timestamp or should it be extracted/parametrized somehow.

Zill
April 9th, 2012, 09:02 PM
I am going through old digital photos and changing time/date stamps on those images that have no exif data. These photos were scanned and saved as .jpegs and to set their date is tedious when I have to re-set hundreds of them one by one. If I could do some of this with batch script, I would. Do you have a suggestion as to where I might find a suitable script that I could modify?
I had a related problem when using mogrify to resize photos while still wishing to retain the original time/date stamp data.

Paddy Landau (http://ubuntuforums.org/member.php?u=572807) very kindly came up with a script to do exactly this - see post #6 (http://ubuntuforums.org/showpost.php?p=9442070&postcount=6) in thread Preserve original datestamp with mogrify? (http://ubuntuforums.org/showthread.php?p=9449553)

While this is not exactly what you wanted, maybe you could use this script as a basis for your task.

Unfortunately, I have to admit that I am unlikely to be able to help further with this as bash scripting is not my strong point. :-(

Hopefully someone more knowledgeable will shortly be able to assist. Good luck!

Michael Dooley
April 10th, 2012, 02:41 AM
I believe Phatch is able to batch process images and metadata. Its in the repository.
Yes, in the repository. Not particularly useful for my needs. Thanks though.

Michael Dooley
April 10th, 2012, 02:52 AM
I had a related problem when using mogrify to resize photos while still wishing to retain the original time/date stamp data.
I *think* jhead might be of assistance in this kind of task. If you have the time, check out jhead.

I *think* that I need a date/time stamp editor that will let me scroll through and select the desired alterations. I would like this to work on any kind of file or even a folder.

Thanks for the suggestions though.

Zill
April 11th, 2012, 07:50 PM
I believe Phatch is able to batch process images and metadata. Its in the repository.
Yes, in the repository. Not particularly useful for my needs. Thanks though.
Why not?

Data stamping: You can write any combination of exif or iptc tags (date, time, aperture, shutter speed, … or other info) automatically on a collection of images.
Source: http://photobatch.wikidot.com/faq

Re jhead I guess you will be back to scripting to do what you want. Not my area unfortunately!

Michael Dooley
April 12th, 2012, 06:59 PM
Yes, in the repository. Not particularly useful for my needs. Thanks though.
Why not?
Phatch will edit the metadata, not the file date/time stamp. Jhead, another photo "editor", will change a jpg file date/time stamp. However, one must use jhead a terminal command and then type in the time/date. I would like an easier to use GUI.

Thanks Zill.

See: http://brainstorm.ubuntu.com/ideatorrent/idea/23505 where others also think a Nautilus control over time and date is a good idea.

dosware
August 5th, 2012, 08:37 PM
If you are dead-set on finding a gui solution and aren't averse to installing KDE apps, KRename has a plugin which can change access and/or modification date and time on a selection of files. I use an older (4.03) version, so I assume recent versions maintain this plugin. The Krusader file manager also integrates/ uses KRename for its mult-rename function.