Dateigröße in Byte ausgeben (ähnlich wie ls -l):
[root@Linux ~]# stat -c '%s' /etc/rc0.d/K01autofs 16
[root@Linux ~]# stat -c '%s %n' /etc/rc0.d/K01autofs 16 /etc/rc0.d/K01autofs
[root@Linux ~]# stat -c '%s %N' /etc/rc0.d/K01autofs 16 '/etc/rc0.d/K01autofs' -> '../init.d/autofs'
[root@Linux ~]# stat /etc/os-release Datei: /etc/os-release -> ../usr/lib/os-release Größe: 21 Blöcke: 0 EA Block: 4096 symbolische Verknüpfung Gerät: 802h/2050d Inode: 135971 Verknüpfungen: 1 Zugriff: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root) Zugriff : 2020-11-29 23:52:29.357355393 +0100 Modifiziert: 2020-08-17 15:31:58.000000000 +0200 Geändert : 2020-11-03 20:25:11.550046955 +0100 Geburt : -
im "terse"-Format
[root@Linux ~]# stat -t /etc/os-release /etc/os-release 21 0 a1ff 0 0 802 135971 1 0 0 1606690349 1597671118 1604431511 0 4096
MTime
[root@Linux ~]# stat -c %y /etc/os-release 2020-08-17 15:31:58.000000000 +0200 [root@Linux ~]# stat -c %Y /etc/os-release 1597671118
CTime
[root@Linux ~]# stat -c %z /etc/os-release 2020-11-03 20:25:11.550046955 +0100 [root@Linux ~]# stat -c %Z /etc/os-release 1604431511
[root@Linux ~]# stat -c "%Y %W" Test.webm 1713591667 1713591054
so kann man sehen, wieviel Zeit zwischen Dateierstellung und der letzten Datenänderung in der Datei, vergangen ist (wie lange es gedauert hat, die Datei zu schreiben); hier sind es 613 Sekunden gewesen:
[root@Linux ~]# stat -c "%Y %W" Test.webm | awk '{print $1 - $2}'
613