how to change the timestamp of a file

how to change the timestamp of a file

Post by hubb » Sat, 12 May 2001 00:57:30



dear unix gurus
is there a way to change the timestamp of a couple of unix-files to a
certain date/time ??
 
 
 

how to change the timestamp of a file

Post by Kurt J. Lanz » Sat, 12 May 2001 01:00:32



>dear unix gurus
>is there a way to change the timestamp of a couple of unix-files to a
>certain date/time ??

"man touch"


 
 
 

how to change the timestamp of a file

Post by Nate Eldredg » Sat, 12 May 2001 02:02:30



> dear unix gurus
> is there a way to change the timestamp of a couple of unix-files to a
> certain date/time ??

man touch

--

Nate Eldredge

 
 
 

how to change the timestamp of a file

Post by Randal L. Schwar » Tue, 15 May 2001 01:54:46


hubby> is there a way to change the timestamp of a couple of unix-files to a
hubby> certain date/time ??

I prefer to change them to an uncertain time, myself. :)  But you can
use the utime(2) system call, or any program that calls it, to do that.

For example, using Perl, set all the files in the current directory
so that they were modified a day ago and accessed right now:


I might have the atime/mtime parameters backwards.  Durn positional
params. :)

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095

Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

 
 
 

how to change the timestamp of a file

Post by Susan Cordov » Fri, 01 Jun 2001 17:33:26


use the touch command.
touch -am MMDDhhmm[CC] <filename>

man page explains what MMDDhhmm[CC] means.  : )



> hubby> is there a way to change the timestamp of a couple of unix-files to a
> hubby> certain date/time ??

> I prefer to change them to an uncertain time, myself. :)  But you can
> use the utime(2) system call, or any program that calls it, to do that.

> For example, using Perl, set all the files in the current directory
> so that they were modified a day ago and accessed right now:


> I might have the atime/mtime parameters backwards.  Durn positional
> params. :)

> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095

> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

 
 
 

1. dir timestamps vs dir/file timestamps

Working on Solaris 7
something i never noticed and now am confused:
i used to think that directory modification time=modification time of
newest file under directory.
Does dir modification time only change
when files are created or removed under that directory?
There's no way to do an ls -ltr and see which directory contains the
newest files?

example:

drwxr-xr-x   3 root     sys          512 Jul 29 03:10 cron

337 joeh [sunji]:/var>cd cron
338 joeh [sunji]:/var/cron>ls -ltr
total 1024
-rw-------   1 root     bin       481504 Jul 29 03:10 olog
-rw-------   1 root     root       30756 Aug  2 11:45 log

--

access to a news server; thanks!
Disclaimer: opinions expressed my own and not representative of my employers

2. Multia Newbie Needs Help!

3. How to change the timestamp of a files?

4. Linux Firewall

5. RedHat 7.2, installing RPMs

6. howto change timestamp of file ?

7. ppp and XF86 3.1.1 anyone?

8. Possible to change file timestamp?

9. how to change the timestamp of file

10. Copying files without changing the timestamp?

11. is there built-in ksh functionality to check if file timestamp has changed

12. is kernel compilation supposed to change header file timestamps?