Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux file time Comments ctime mtime atime     - Compiling source code Nginx module installation subs_filter (Server)

- grep search from files and display the file name (Linux)

- OpenStack image production in the CentOS 6.2 (Linux)

- True and false in Perl (Programming)

- Kernel compile under Debian (Linux)

- Nodejs mysql pool Example (Programming)

- RHEL7.0 configuration CD-ROM to the local YUM (Linux)

- Installation GitLab appears ruby_block supervise_redis_sleep action run (Linux)

- Install apr support for Tomcat on Linux (Server)

- Java NIO2: Buffer (Programming)

- HBase cluster installation and deployment (Server)

- Linux system components Detailed log (Linux)

- Linux system security settings (Linux)

- Some common regular expressions (Linux)

- Android first line of code study notes (Programming)

- How to migrate MySQL to MariaDB under linux (Database)

- How to use the TF / SD card making Exynos 4412 u-boot boot disk in Ubuntu (Linux)

- Formatting Java floating-point types (Programming)

- Tomcat session clustering and server session (Server)

- Vi / Vim prompt solutions do not have permission to save time (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:      
 
- Programmer editor Vim (Linux)
- Ubuntu under shadowsocks configuration instructions (Linux)
- Initialization and starting process of Linux (Linux)
- Why is the ibdata1 file growing in MySQL? (Database)
- Source code compiled by the installation program under Linux (Linux)
- Nodejs mysql pool Example (Programming)
- Define and modify strings principle in Python (Programming)
- PF_RING 6.0.2 compiled and installed on Redhat 6.3 x86_64 (Linux)
- Linux kernel boot to retain large memory method summary (Linux)
- CentOS / Linux restart active NIC connection paths / network configure error Error Resolution (Linux)
- CoreOS use register mirror to build private warehouse (Linux)
- CentOS7 install MySQL5.6.22 (Linux)
- Spring next ActiveMQ combat (Programming)
- Distributed Hadoop1.2.1 cluster installation (Server)
- How to install and configure in Ubuntu 14.10 'Weather Information Indicator' (Linux)
- VMware11 virtual machine Ubuntu14.10 system partition sda1 disk expansion (Linux)
- Object-C in the preparation of multi-parameter function parameter is omitted (Programming)
- OpenSSH version smooth upgrade method (Linux)
- How to manage start-up applications in Ubuntu (Linux)
- Ubuntu install VMware Workstation 11 tutorials at 14.04 / 14.10 (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.