Terminal Dojo
Help العربية Sign inGet started

Command library / stat

stat

BashDraft — pending expert review3 practice missions

Show a file's metadata and timestamps

Prints everything the filesystem knows about a file except its contents: size, owner, permissions, inode, and three timestamps. Modify is when the content last changed; Change is when the metadata last changed (permissions, owner, links); Access is when it was last read. In an investigation they help build the timeline: a Change time newer than Modify usually means the permissions or ownership were altered after the content was written.

Practice stat

Usage

stat [-L] [-c FORMAT] file...

Options and flags

Examples

Common mistakes

stat -c /var/log/auth.log stat -c %y /var/log/auth.log

-c takes a format first; here it swallows the path as the format and has no file left to describe.

Related commands

lssha256sumfind