Getting file information using stat

Getting file information using stat

stat prints file information, including last modified, changed or accessed time.

On Unix systems every file has 4 timestamps:

ctimechange time – when the file was modified, permissions changed, etc.
atimeaccessed time – when file was read (counting utilities such as grep)
mtimemodified time – when the file content was changed
birthcreated time – not used because it has no value

By default ls -l shows only mtime, ls –time= option can display atime or ctime instead, but it’s much convenient to use stat:

stat example linux
stat example linux

For more options run man 1 stat

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.