![]() ![]() Similarly, let’s view the file content and then check the timestamp. The stat command shows all three timestamps at once so you don’t need to multiple checks the timestamp.Īs you can see all three timestamps have the same date and time. Then view the timestamp using the stat command. The stat is a command-line utility to view more details about the files or in general to view the detailed timestamp of the file. Use the touch command to create a new file and check all three timestamps using the stat command. Let’s see how the timestamp is applied to the file. Whenever we view the file timestamp the system will change the number of seconds into human-readable format. How does file timestamp work?Īs mentioned earlier the system doesn’t store the actual date and time instead, it stores it in the number of seconds in Unix Epoch or Unix Time. You can view the ctime of the file by using the -lc option to the ls command. Changed Timestamp also records time when you modify the file. When you change the file-related metadata i.e file permission, file ownership, etc., then the ctime of the file gets updated. You view the modified time using the ls command with the -l option to the command. Modified Timestamp indicates the last time a file gets modified whether you append, edit or remove the content inside the file. When you change the content inside the file the Linux system updates the mtime of the file. You can use the ls command with the -lu option to view the atime. In general, access timestamp refers to the last time when the system or the user used a program or command to display the content inside the files. When you access the file through any command, process, and script the system will update the access time of the file or document. Let's first discuss the definition and how we can display it in our Linux system. I have used for all the examples in this article an Ubuntu 20.04 system. This article will help you understand Linux file timestamps and how file timestamps work. The Unix epoch is the number of seconds from 00:00:00 on January 1, 1970. Linux stores the timestamp in the Unix epoch instead of the actual date and time. In the Linux system, the system provides a file with three timestamps, namely access timestamp (atime), change timestamp (mtime), and change timestamp (ctime). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |