Three important times in Linux
First, definition
Chang time: referred to as ctime, the change time of a file or directory. In Linux, it is basically impossible to know the exact creation time of a file. The change time refers to the time when the attributes (owners, permissions, etc.) of the file or directory are modified. If a file needs to be backed up, the dump command needs to use ctime. You can use the ls-lc command to view ctime.
Access time: referred to as atime, the access time of a file or directory. It is the time when the data of a file was last accessed. For example, displaying the contents of a file or running a shell script will update the atime of the file. You can view it with the ls-lu command.
Modify time: referred to as mtime, the modification time of a file or directory. Is the time when the current content of the file is last modified, this is a time displayed in the long directory list
Second, how to modify
In Linux, the status command will be displayed three times,
For example: $cat file atime will be updated
$chmod g+w file ctime will be updated
$ echo “File contentss” > file file ctime And mtime will be updated.
Three time states for Linux files and directories:
1 mtime: Time when the file or directory was last modified
2 ctime: Last changed file or directory (change The time of the original data, ie the attribute, such as the time at which the inode node of the file was modified. And chmod, chown and other commands can also change this value.
3 atime: The time when the file or directory was last accessed.
For files, ctime must be changed when mtime is modified, because file size and so on are attributes. Some people say that atime will also change. To modify files, you must first access them. Actually, it is wrong, no access. The file can also be modified, such as #echo“Thos is a test”>>/etc/issue, the contents of the file will change, but the file is not accessed, so atime has not changed.
For a directory, access a directory with its atime change, mtime, and ctime. Modify a directory, touch a file in a directory, mtime and ctime will change, atime does not necessarily change.
Use the stat command to view three time values, such as stat filename. You can also use ls -l file to view file modification time, ls -lc file to view file status change time, and ls -lu file to view file access time. .
We all know that the Linux rm command can delete files, but if you want to delete the directory, you
The pstree command shows the derived relationship between processes in a tree diagram, and
First, the installation package software Here are some necessary, I will attach the downlo
What should I do if the Ubuntu system Grub fails? Many computer users think of reloading: Grub, howe
5 things to pay attention to when reinstalling Windows system
Serial hard disk, parallel port hard disk and the difference between the two
What if the Win8 system does not have a group policy?
Global Partner Conference Microsoft Showcases New Products and Services
XP SP2 "camouflage" becomes a hidden danger in XP SP3
How to disable IPv6 in Linux systems
DNF male roaming sharp brush map plus sharing DNF male roaming brush map how to add
Win8.1 upgrade Win10 encountered 80240016 error response
Why is the IE8 browser under Windows 7 click on the webpage with a sound