Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux file time Comments ctime mtime atime     - Nginx supports user multi-threaded downloads and resume broken (Server)

- Linux Network Programming - libnet Guide (Programming)

- CentOS 6.5 start ActiveMQ being given to solve (Server)

- Network Security Basics Linux command (Linux)

- Modify MySQL character encoding under Linux (Database)

- VNC connection VMware vSphere ESXi 5.5 (Linux)

- The istgt PSD on ported to Mac OS X (Linux)

- CentOS yum install LNMP PHP5.4 version (Server)

- Windows7 / 8 / 8.1 hard drive to install Ubuntu 14.04 dual system (Linux)

- Linux administrator should command: sed and awk (Linux)

- Inject script commands manually annotated summary (Linux)

- namespace mechanism Linux kernel analysis (Linux)

- Linux kernel RCU (Read Copy Update) lock Brief - prequel (Linux)

- To disable the function by pressing Ctrl-Alt-Del to restart the system in RHEL / CentOS 5/6 (Linux)

- Introduction and bash history command to quickly call (Linux)

- Swift acquaintance of values and references, the circular reference, Agent Precautions (Programming)

- Slice MyCAT common fragmentation rules of enumeration (Database)

- C ++ in the elimination Wunused (Programming)

- Linux operation and maintenance of the automated installation and deployment RHEL7.0 Cobbler (Linux)

- How to use Evernote in the Linux command line (Linux)

 
         
  Linux file time Comments ctime mtime atime
     
  Add Date : 2017-08-31      
         
         
         
  Linux file system has three major time attributes, namely, ctime (change time), atime (access time), mtime (modify time). It is easy to confuse the three time to prepare in-depth understanding of Linux's shoes, please tell the difference between these three

atime: Access time, when reading files or executable file changes, the last time the file that is being read.
Description: st_atime
          Time when file data was last accessed. Changed by the
          following functions: creat (), mknod (), pipe (),
          utime (2), and read (2).

mtime: Modified time, is written to the file with the changes to the file content to change, refers to the contents of the file was last modified.
Description: st_mtime
          Time when data was last modified. Changed by the fol-
          lowing functions: creat (), mknod (), pipe (), utime (),
          and write (2).

ctime: Change time, is written to the file, change the owner, with the Inode content and changes when setting permissions or link that file status was last changed time.
Description: st_ctime
          Time when file status was last changed. Changed by the
          following functions: chmod (), chown (), creat (),
          link (2), mknod (), pipe (), unlink (2), utime (), and
          write ().
A lot of people understand it as create time, including many misleading books is so written. Ctime actually refers to change time.

note:
1, modify the content of the text itself is changed (mtime)
      Change is the inode file has changed (ctime)
2, if you modify the contents of the file, the update ctime and mtime
3, if only the file inode change, such as modifying permissions, you just change the ctime

4, if you use the ext3 file system when in use when the noatime mount parameter will not update atime information that atime will not be modified after the access to the file, but this does not represent the real situation

Tips: This three time stamp are placed in the inode. If the mtime, atime modify inode will certainly change, the corresponding inode change, and that ctime will follow to change, the reason for using the noatime mount option, the file system just do not want to make too many changes to improve reading performance.

atime view files, ctime and mtime.
ctime # ls -lc filename listed in files
# Ls -lu filename listed atime file
mtime # ls -l filename listed in files

example
1: # echo "Hello World" >> myfile atime constant while varying the ctime and mtime
2: # cat myfile ctime and mtime constant, changing only atime
      # Ls myfile
                    ctime and mtime and atime not change
3: # chmod u + x myfile mtime and atime constant, only change the ctime
4: # mv myfile ../
                    mtime and atime constant, only change the ctime

Other extensions:
relatime property

From kernel2.6.29, the default integrates a relatime attributes. After using this feature to mount the file system only if mtime than atime update time, will update atime.

scenes to be used:
Read in the file system very frequently, atime update brings much overhead, so use noatime mount the file system attributes in time to stop the update atime. But some procedures require some judgment and operate according to atime, this time relatime feature comes in handy. In fact, in fact, this time the atime and mtime are already the same time, so this option is to be understood that in order to achieve compatibility of atime was launched, time is not a new property.
Use: # mount -o relatime / dir ## mounted directory when adding parameters relatime
     
         
         
         
  More:      
 
- Linux Log Clear (Linux)
- Linux Samba server-side structures and the use of the client (Server)
- Use exp exported EXP-00091 error (Database)
- Debian 7 and Debian 8 users how to install Oracle Java 8 (Linux)
- Deploy the project to the server from GitHub (Server)
- Flow control message transmission between RAC (Database)
- IPTABLES configuration steps under Linux (Linux)
- Computer black magic: tail recursion (Programming)
- Use py2exe to generate exe files Python script (Programming)
- To share some very useful Vim command (Linux)
- Linux productivity tools and tips (Linux)
- Why not use the ifconfig command under RedHat Linux 5 (Linux)
- Linux operating system Study Notes (Linux)
- Ubuntu and derivative users to install the system launcher SimDock 1.3 (Linux)
- Using PHP MySQL library (Programming)
- SQL MySQL query table duplicate data (Database)
- Java loop list to solve the problem of Joseph ring (Programming)
- Chkconfig command Detailed service is added and shut down the system in two ways to start service under Linux (Linux)
- Linux environment SSH login password instead of using the RSA Certificate (Linux)
- Linux Mint brightness adjustment --xrandr command learning (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.