![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| move file change timestamp | tekster757 | UNIX for Dummies Questions & Answers | 2 | 08-10-2007 10:01 AM |
| change timestamp of file | isingh786 | HP-UX | 1 | 05-15-2006 10:56 AM |
| get a file's timestamp | shihabvk | UNIX for Advanced & Expert Users | 1 | 05-30-2005 03:18 AM |
| checking file's permissions and change them | K-ONE | Shell Programming and Scripting | 7 | 04-10-2005 06:09 AM |
| Timestamp of File permission change | jyotipg | UNIX for Advanced & Expert Users | 1 | 02-19-2003 12:02 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Change a file's timestamp
Hi,
I want to modify a file and then change the file's timestamp back to what it was before the modification. It should look as if the file has'nt been modifed. The entire operation needs to be done inside a ksh script. Can anyone suggest how I can trap a file's stamp in a variable within a shell. Thanks in advance. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Hi,
Try touch command if files present time stamp is may 10 10:24 Modify ur file, then give the following command touch -t 200805101024 filename Decomposition of 200805101024 2008 year , 05 - month number , date, time Thanks Penchal |
|
#3
|
|||
|
|||
|
Thanks for the response. I used touch -t several times. What I wanted to know is, how to trap the timestamp of the file within a shell in a format which can be fed to "touch" command. I want to get the file's timestamp in YYYYMMDDHHMI format.
Thanks in advance. |
|
#4
|
|||
|
|||
|
ls -ltr filename
_rw_rw_rw_ 1 penchal grp 1024 May 13 18:08 filename Ur timestamp becomes : 200805131808 |
|
#5
|
|||
|
|||
|
Sounds like someone is trying to do something fishy "file should appear as if it has not been modified"
foo.c -> apps/gendev/src/foo.c the timestamp on apps/gendev/src/foo.c is say 'May 27 11:37' the timestamp on foo.c (which points to the source file) is 'May 27 10:42' which is when the link was created. Everytime I edit foo.c from my directory the timestamp on apps/gendev/src/foo.c is updated which I understand because I am really modifying that file. I want to know if there is a way to modify the timestamp on the link without relinking the file? Thanks |
|
#6
|
|||
|
|||
|
rcarnesiii.
Please don't hijack another ones thread but open a new thread for your question. Thanks. |
|
#7
|
||||
|
||||
|
FYI: The time is only shown if the timestamp is less than 6 months old. If it's more than 6 months, the ls command shows the year instead of time.
|
||||
| Google The UNIX and Linux Forums |