LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 01-18-2005, 08:28 PM   #1
digitalgravy
Member
 
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?

Thanks
 
Old 01-18-2005, 08:52 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"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
digitalgravy
Member
 
Registered: Nov 2003
Posts: 86

Original Poster
Rep: Reputation: 15
Thanks,

I know how to use the touch command.

I use it in the following way


Code:
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.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:24 AM.

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