stat — file metadata
cheat sheet · GNU coreutils https://lab.dimsanych.ru/en/wiki/stat/Cheat sheet
-
stat fileeverything -
stat -c '%a %U:%G %n' filepermissions-owner-name -
stat -c '%Y' filemtime (unix) -
ls -lc filectime instead of mtime
Options
The -c flag sets a custom output format via placeholders (%a, %U,
%s, and others) — without it, stat prints a fixed multi-line block
that's inconvenient to parse in scripts. -L (--dereference) switches
the output from the link itself to the file it points to; without it,
checking permissions with stat on a symlink shows the link's
permissions (usually 777), not the file's.