Ad space (banner)
🖥️Linux Lessons
Lesson 54 / 61

Checking a File's Details with stat

stat is for when "I want detailed info about this file — its creation time, size, and more." stat displays a given file's detailed info: size, permissions, creation/modification/access timestamps, and more.

Use it in the form stat filename. It gives you even more detail than ls -l — modification time, access time, inode number, and more.

Running stat notes.txt displays notes.txt's size, permissions, owner, and various timestamps in detail.

A common early mistake is confusing the displayed "modification time" with "access time." The time content was actually rewritten, and the time it was merely opened and read, are recorded separately.

In real work, this is used when you need to precisely determine when a file was last updated — investigating log tampering, verifying backup consistency, and more.

Linux
Try it (type this into the pseudo terminal)
stat notes.txt

🧑‍💻 You can type this command into the Linux pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)