Atimemtimectime in linux

Source: Internet
Author: User
Tags tmp file touch command
Atimemtimectime1.mtime (medifytime) in linux: The last time the file or directory was modified. ctime (changtime): The time at which the last file or directory (the original data is changed: attribute) is changed, for example, the time when the inode node of the file is modified. Touch Command... atime mtime ctime 1 in linux. mtime (medify time): The last time the file or directory was modified. ctime (chang time): The time at which the last file or directory (the original data is changed: attribute) is changed, for example, the time when the inode node of the file is modified. In addition to the-d and-t options, the touch Command changes the time. In addition, commands such as chmod and chown can also change the value. 3. atime (access time): The time when the last file or directory is accessed. for files: When the mtime is modified, the ctime must change. because the file size and so on are all attributes, some people say that atime will also change. to modify the file, you must first access it. In fact, it is wrong to modify the file without having to access it: for example: # echo "This is a test!"> The content of the/etc/issue file changes, but the file is not accessed, so atime does not change. for a directory: access a directory whose atime changes, mtime and ctime remain unchanged; modify a directory: touch a file under a directory, mtime and ctime will change, and atime will not always change; for example: [root @ station16 ~] # Stat/tmp file: '/tmp' size: 135168 Blocks: 280 IO Block: 4096 directoryfevice: fd00h/64768d Inode: 2555905 Links: 8 access: (1777/drwxrwxrwt) Uid: (0/root) Gid: (0/root) access: 09:15:59. 000000000 + 0800 modify: 09:15:57. 000000000 + 0800 change: 09:15:57. 000000000 + 0800 [root @ station16 ~] # Cd/tmp [root @ station16 tmp] # touch text.txt [root @ station16 ~] #! Sstat/tmp file: '/tmp' size: 135168 Blocks: 280 IO Block: 4096 directorydevice: fd00h/64768d Inode: 2555905 Links: 8 access: (1777/drwxrwxrwt) Uid: (0/root) Gid: (0/root) access: 09:15:59. 000000000 + 0800 modify: 09:31:39. 000000000 + 0800 change: 09:31:39. 000000000 + 0800 [root @ station16 ~] # Atime changes, mtime and ctime remain unchanged: [root @ station16 ~] # Stat/tmp File: '/tmp' Size: 135168 Blocks: 280 IO Block: 4096 directorydevice: fd00h/64768d Inode: 2555905 Links: 8 access: (1777/drwxrwxrwt) Uid: (0/root) Gid: (0/root) access: 09:15:59. 000000000 + 0800 modify: 09:31:39. 000000000 + 0800 change: 09:31:39. 000000000 + 0800 [root @ station16 ~] # Cd/tmp [root @ station16 tmp] # lsaa text text.txt [root @ station16 ~] #! Sstat/tmp file: '/tmp' size: 135168 Blocks: 280 IO Block: 4096 directorydevice: fd00h/64768d Inode: 2555905 Links: 8 access: (1777/drwxrwxrwt) Uid: (0/root) Gid: (0/root) access: 09:35:49. 000000000 + 0800 modify: 09:31:39. 000000000 + 0800 change: 09:31:39. 000000000 + 0800 view file attributes: Use the stat command to view the three time values. for example, use the stat filename command: ls-l file: To view the file modification time. ls-lc file: view file status change time ls-lu file: View file access time
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.