In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of what the three times in the Linux system file are, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value, I believe you will gain something after reading the three times in this Linux system file, let's take a look.
In the Linux system, a file involves three times, namely: atime (access time): last accessed file content time, mtime (modify time): last modified file content time ctime (change time): the time when the file property was last changed (Inode content change).
Three times of the file
I believe you are already familiar with the windows operating system. When we create a file under the windows system, the system will also establish relevant parameters for the file to describe the file, as shown in the figure:
These parameters include the file size, file type, location, and the creation, modification, and access time of the three files. So let's see if there are similar parameters in Linux? Under Linux, we can view the relevant parameters of the file with the stat+ file name. The specific parameters are explained as follows:
Under the file system in Linux, we find that in addition to the file size, file name, file time, etc., there is also more information about Inode number and block, which is mainly related to the composition of the Linux file system. In Linux, a file has an Inode number, an Inode number corresponds to at least one block block, bolck is the structure to access the file content, and the number of file block blocks is related to the file size, and under the Linux system The size of the block block is fixed. Today we mainly introduce three times under the Linux system, they are Access Time (access time), Modify Time (modification time), and Change Time (change time).
Atime
Atime is the abbreviation of Access Time, which is called access time in Linux file system. When the contents of a file are accessed, this time is updated. For example, when we use commands such as cat, more, less to view the contents of a file, the access time of the file is updated, as shown below:
Mtime
Mtime is the abbreviation of Modification Time, which means that when the "content data" is modified, the Linux system will update this time, for example, we use instructions such as echo,vim to write data to the file.
In the figure above, when we write a string to the test.txt file with the echo instruction, we find that both mtime and the ctime we are going to mention below have been changed. Let's go to the ctime below to see why this result occurs!
Ctime
Ctime is the status time in the Linux system, that is, the state time, when the state of the file, that is, the properties of the file is changed, such as links (number of links), size (size of the file), permissions of the file, blocks (number of block of the file) in the file system; when these parameters are changed, Linux will change the time parameter corresponding to the file.
Now you may understand why the mtime of the file was changed when you just modified the ctime of the file, because when the content of the file is modified, the size of the file, that is, size, is bound to change, so the status time of the file will be updated with the content of the file being modified. So if the mtime of the file is modified, the ctime of the file will also be changed.
Other ways to view file time
1.ls-l +-time=xx time + file name
By default, this query method displays the mtime of the file.
2.ls-lx + file name
In this query mode, cctimeuatimels-lc filename lists the ctime of the file (last change time)
Ls-lu filename lists the atime of the file (last access time)
Ls-l filename lists the mtime of the file (last modified)
This is the end of the article on "what are the three times in the Linux system file?" Thank you for reading! I believe you all have a certain understanding of the knowledge of "what is the three times in the Linux system file". If you want to learn more knowledge, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.