Linux file access time, change time, modify time

sponsored links
Linux file change time and Modify time a lot of people very easily confused, and some Unix reference books are wrong (especially the translation),
Ctime will be understood as create time (creation time), it is nonsense, Linux file system does not record create time, unless the file is created after, no modify, no change, then the file creation time and modify the same time and change time.
Quote:

[Root @ test200 temp] # stat libnids-1.16.tar.gz
File: `libnids-1.16.tar.gz '
Size: 72309 Blocks: 152 IO Block: 4096 regular file
Device: 302h/770d Inode: 4113144 Links: 1
Access: (0644/-rw-r--r--) Uid: (0 / root) Gid: (0 / root)
Access: 2008-05-27 15:13:03.000000000 +0800
Modify: 2004-03-10 12:25:09.000000000 +0800
Change: 2008-05-27 14:18:18.000000000 +0800

access time is the last time the document was read time. So read a document updates its access time, but time and modify it
change the time did not change. cat, more, less, grep, sed, tail, head these commands will modify the file access time.

change time is the index of the document node (inode) changed (such as location, user attributes, group attributes, etc.);

modify time is the content of the text itself has changed. [Also known as document modify time stamp (timestamp).]
Quote:

st_atime
Time when file data was last accessed. Changed by the
following functions: creat (), mknod (), pipe (),
utime (2), and read (2).

st_mtime
Time when data was last modified. Changed by the fol-
lowing functions: creat (), mknod (), pipe (), utime (),
and write (2).

st_ctime
Time when file status was last changed. Time of last modification of file status information.Changed by the
following functions: chmod (), chown (), creat (),
link (2), mknod (), pipe (), unlink (2), utime (), and
write ().

chmod, chown, create, mv and other actions will modify the Linux file change time for the current system time

ls command to see the modify time

Using tools such as wget to download the file, cahnge time will not be modified.

Using tools such as vi to edit a file has been saved, modify time will be modified.

Use ls-l command does not modify the file access time, but the cat command will modify the access time.
Quote:

ls-lu (show files access time and sort by name)
ls-lc (show files change time and sort by name)
ls-l (show files modify time and sort by name)

If combined with-t parameter, sorted according to the corresponding time display. Together - time-style = long-iso, the file will be the appropriate date when the minutes and seconds displayed all the time.

touch command to change the file access time and modify time for any given time.

modify time to change the system time can not be changed any time. Even with c program to directly read and write inode, does not modify the change time.

Added: vi command modifies the file access time, regardless of whether the contents of files changes; if the file content changes, but also modify the file modify time, access time, and at this time
modify time is different, access time is the time just open the file, modify the contents of the file is saved out of time.
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of Linux file access time, change time, modify time

  • Basic knowledge of AJAX

    United ScriptManager and UpdatePanel controls can be achieved using asynchronous partial page update results. One of the UpdatePanel is set asynchronous partial page update, it must rely on ScriptManager exist, because ScriptManger control provides c ...

  • hibernate second cache

    hibernate cache Secondary cache, also known as process-level cache or SessionFactory-level cache, secondary cache can be shared by all of the session Secondary cache and the life cycle of the life cycle of SessionFactory consistent, SessionFactory to ...

  • Examples of instructions needs analysis

    Examples of instructions needs analysis 1.1 The purpose of the preparation At completion of the "file management system" software pre-market survey, at the same time with a number of software users a comprehensive and in-depth study and analysis

  • CentOS 5.2 on the deployment of rails applications

    Today at a newly installed server to deploy a rails small Web site, the system is Centos 5.2, the direct use of convenience of the system built-in apache and mod_rails. 1. First of all rpm -qa|grep -i ruby The system comes with the ruby version is 1.8.5,

  • drails1.0 released at rails easily use dojo!

    drails The rails are a plugin, it uses dojo to replace the rails default Prototype and Scriptaculous. Dojo implementation based on the bulk of the JS Helper, but did not fully realize RJS. Author readme file That the more detailed: drails======= drails al

  • fedora8 install ror

    Fedora installation of Ruby on Rails Pre-action The following are the action is for the whole process has helped, but not necessarily the way to do. 1. Modify yum server, refer to the server internal I-Shou vi / etc / yum.repos.d / fedora.repo baseur ...

  • 20 principles of needs analysis

    1, analysis of staff in line with the client to use the expression language habits The discussion focused on the needs of business needs and mission, and therefore the use of the term. Customers should be on the terms (for example: mining price of me ...

  • Ruby Design Pattern

    Ruby Design Pattern This book is about a focus on aspects of design patterns book. This book user-friendly way to introduce the Ruby design patterns, including an overview of Ruby, the use of Template Method Transform algorithm, using the strategy of repl

  • Do not believe mongrel_rails cluster:: start!

    Update code after Action (No action responded to xxx) error. Check the code, has been updated. Change the action name, change the path is always error. Baffled. In the system under ps ax | grep mongrel, found that Mongrel can not find the process! Bu ...

  • Hibernate pessimistic locking mechanism for locking and optimistic locking

    hibernate lock mechanism 1. Pessimistic lock It refers to the modification of data by outsiders hold a conservative attitude. The assumption that at any time access to data, may also have another client to access the same data, in order to maintain t ...

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries