Benutzer-Werkzeuge

Webseiten-Werkzeuge


freebsd:stat_freebsd

Dies ist eine alte Version des Dokuments!


stat (FreeBSD)

Dateigröße in Byte ausgeben (ähnlich wie ls -l):

[root@FreeBSD14 ~]# stat -f '%z' /etc/rc.conf
5264
[root@FreeBSD14 ~]# stat -t '%Y-%m-%d %H:%M:%S' /etc/rc.conf
7169357729625349425 1941190 -rw-r--r-- 1 root wheel 18446744073709551615 5264 "2024-02-24 20:14:41" "2024-03-10 17:16:01" "2024-03-10 17:16:01" "2024-02-24 20:14:41" 5632 9 0x800 /etc/rc.conf
[root@FreeBSD12 ~]# stat -x /etc/rc.conf
  File: "/etc/rc.conf"
  Size: 12785        FileType: Regular File
  Mode: (0644/-rw-r--r--)         Uid: (    0/    root)  Gid: (    0/   wheel)
Device: 1722667192,18446744072235384998   Inode: 610408    Links: 1
Access: Sat Jun 18 14:13:52 2016
Modify: Wed Nov 25 22:02:27 2020
Change: Wed Nov 25 22:02:27 2020
[root@FreeBSD12 ~]# stat -t '%Y-%m-%d %H:%M:%S' /etc/rc.conf
7398799417561757862 610408 -rw-r--r-- 1 root wheel 18446744073709551615 12785 "2016-06-18 14:13:52" "2020-11-25 22:02:27" "2020-11-25 22:02:27" "2016-06-18 14:13:52" 13824 33 0x800 /etc/rc.conf
[root@FreeBSD12 ~]# stat -x -t '%Y-%m-%d %H:%M:%S' /etc/rc.conf
  File: "/etc/rc.conf"
  Size: 12785        FileType: Regular File
  Mode: (0644/-rw-r--r--)         Uid: (    0/    root)  Gid: (    0/   wheel)
Device: 1722667192,18446744072235384998   Inode: 610408    Links: 1
Access: 2016-06-18 14:13:52
Modify: 2020-11-25 22:02:27
Change: 2020-11-25 22:02:27
[root@FreeBSD14 ~]# stat Test.webm
687931145 72687 -rw-r--r-- 1 quarzsnoopy dlna 18446744073709551615 42245351 "Apr 20 07:30:54 2024" "Apr 20 07:41:07 2024" "Apr 20 07:41:07 2024" "Apr 20 07:30:54 2024" 131072 82577 0x800 Test.webm

[root@FreeBSD14 ~]# stat -x Test.webm
  File: "Test.webm"
  Size: 42245351     FileType: Regular File
  Mode: (0644/-rw-r--r--)         Uid: ( 1009/quarzsnoopy)  Gid: (  933/    dlna)
Device: 255,687865865   Inode: 72687    Links: 1
Access: Sat Apr 20 07:30:54 2024
Modify: Sat Apr 20 07:41:07 2024
Change: Sat Apr 20 07:41:07 2024
 Birth: Sat Apr 20 07:30:54 2024

[root@FreeBSD14 ~]# stat -f "\"%Sc\" \"%SB\"" Test.webm
"Apr 20 07:41:07 2024" "Apr 20 07:30:54 2024"

[root@FreeBSD14 ~]# stat -t "%s" -f "%Sc %SB" 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@FreeBSD14 ~]# stat -t "%s" -f "%Sc %SB" Test.webm | awk '{print $1 - $2}'
613
/home/http/wiki/data/attic/freebsd/stat_freebsd.1714853468.txt · Zuletzt geändert: von manfred