Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to query the modification time of files by linux

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "linux how to query the modification time of the file". In the daily operation, I believe that many people have doubts about how to query the modification time of the file in linux. The editor consulted all kinds of data and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the doubt of "how to query the modification time of the file by linux". Next, please follow the editor to study!

Linux query file modification time method: 1, the implementation of the "stat filename" command, the output of the "Modify Time" item information is the modification time; 2, the implementation of the "ls-l filename" command, the output is the modification time.

The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

Modification time (modifytime): this time will be updated if you modify the contents of the file once.

For example, after using tools such as vim to change the contents of the file and save it, the modification time of the file changes.

Linux query the modification time of the file

1. Stat command

Use the stat filename command to view the file, as shown in the figure

Will show that there are three times

Access Time: abbreviated as atime, indicating the access time of the file. Update this time when the contents of the file are accessed

Modify Time: abbreviated as mtime, indicating the modification time of the contents of the file, which is updated when the data content of the file is modified.

Change Time: abbreviated as ctime, indicating the status time of the file, which is updated when the status permission of the file is modified, such as the number of links, size, permissions, and Blocks of the file.

Among them, modify generally represents the modification time, so we can test it by experiment.

Echo "This is a test" > > 123.txt

See that the modification time of the file Modify Time has changed

2. Ls command

The ls-l command views the file. The default view is mtime, that is, the most recent modification time of the file.

At this point, the study on "how to query the modification time of files by linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report