[NBLUG/talk] GNU touch, and the file creation date

Troy Arnold troy at zenux.net
Thu Feb 28 23:52:47 PST 2008


On Thu, Feb 28, 2008 at 09:27:02PM -0800, Kyle Rankin wrote:
> On Thu, Feb 28, 2008 at 09:20:10PM -0800, Rick wrote:
> 
> > 
> > Aside :  when viewing the file access date, by using the ls command, it
> > appears that the file access date is reset to the current datetime
> > after the results are displayed.  Is there any way to view the file
> > access date without changing it?
> > 
> > >ls -l --time=access filename
> > 
> 
> The only way to view the access time without then modifying the access
> time is to do so from a read-only file system. By the way, you will also
> modify the access time of the file's directory when you access it.

That's not what I'm seeing (tested on xfs and ext3):
Thu Feb 28 21:49:09 HST 2008
[troy at saiph ~/files]$ ls -l --time=access z*
-rw-rw-r-- 1 troy troy 1504 2008-02-28 18:11 zenux.dns
-rw-rw-r-- 1 troy troy 6392 2008-02-28 18:14 zsafe.zsf
[troy at saiph ~/files]$ date
Thu Feb 28 21:49:12 HST 2008
[troy at saiph ~/files]$ ls -l --time=access z*
-rw-rw-r-- 1 troy troy 1504 2008-02-28 18:11 zenux.dns
-rw-rw-r-- 1 troy troy 6392 2008-02-28 18:14 zsafe.zsf
[troy at saiph ~/files]$ cat zenux.dns
[...]
[troy at saiph ~/files]$ ls -l --time=access z*
-rw-rw-r-- 1 troy troy 1504 2008-02-28 21:49 zenux.dns

'mount -o remount,noatime /home' works to prevent the access time
modification...

-t



More information about the talk mailing list