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

Kyle Rankin kyle at nblug.org
Fri Feb 29 00:10:51 PST 2008


On Thu, Feb 28, 2008 at 11:52:47PM -0800, Troy Arnold wrote:
> 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
> 

Hah! I totally forgot about the noatime mount argument! There's also a new
"relatime" option you can use that will allow access times to be modified,
but only if they are far enough apart (the idea is to still get the benefit
of Atime but without constantly thrashing the disk).

-- 
Kyle Rankin
NBLUG President
The North Bay Linux Users Group
http://nblug.org
IRC: greenfly at irc.freenode.net #nblug 
kyle at nblug.org



More information about the talk mailing list