Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-18-2005, 08:28 PM   #1
Registered: Nov 2003
Posts: 86

Rep: Reputation: 15
file dates

I want to do a global search and replace for all the templates in a website.

I have a php script that displays the date the page was last modified. I want to keep the original dates, but I want to change the name of a few includes.

Is there a way to record all of the file dates, and make my changes, save the files, then restore the provious time stamps?

Old 01-18-2005, 08:52 PM   #2
LQ Guru
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,863

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
"Is there a way to record all of the file dates, and make my changes, save the files, then restore the provious time stamps?"

You can save the original time stamp, . . ., save the file, and then use the touch command -t option to change the file time stamp back to the original time stamp. See man touch.

Steve Stites
Old 01-20-2005, 10:58 AM   #3
Registered: Nov 2003
Posts: 86

Original Poster
Rep: Reputation: 15

I know how to use the touch command.

I use it in the following way

touch -mt 200409101014.19
So that I can change it down to the second.

I was in a hurry writing the previous question so I wasn't so clear.

What I want to do is find a way to record the last modified time stamp of every file in the website root directory and all of the subsequent directories, then make my changes to the pages, then run the touch command to restore the old last modified times.

I am inserting some new meta tags and changing some includes and I would like to keep the old times.

So is there a way to record all of those time stamps in a file along with the path to the file, then restore all of them with the touch command?

Thanks in advance.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
file created/accessed dates plainkeyman Linux - General 4 10-27-2005 07:34 PM
Trouble working with file dates cboxall Linux - Newbie 2 07-21-2005 11:11 AM
File Dates Rv5 Programming 5 09-07-2004 05:59 PM
Sorting a file containing dates subu_s Linux - General 2 06-03-2004 01:07 PM
File dates. vexer Programming 5 04-28-2004 12:14 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:44 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration