
간결한 출력으로 stat 명령 실행 결과를 해석하는 방법에 대한 단서는 제공되지 않습니다.
[root@kvm devicemapper]# stat -t data
data 107374182400 3887728 8180 0 0 fd01 559688 1 0 0 1633555816 1610128779 1610128779 0 4096
나는 여기서 무엇을 보고 있는 걸까? 나는 그러한 가치 중 일부를 인식합니다. 이러한 값 중 일부는 중복으로 인해 해당 값이 나타내는 속성에 매핑될 수 없습니다.
stat --version
stat (GNU coreutils) 8.22
고쳐 쓰다--help
: coreutils 개발자는 실제 시스템 종속 형식 문자열을 사용 설명서에 추가하여 이후 버전에서 이 문제를 해결한 것 같습니다 . stat --help
동등한 압축 형식에 대한 출력을 참조하세요.https://github.com/coreutils/coreutils/blob/ebf2c4dcc687c9f057a8a22674fd984aa929012e/src/stat.c#L1792
답변1
검사 후암호coreutils 8.22의 경우 내 시스템의 간결하고 동등한 printf 형식은 다음과 같습니다(selinux를 활성화하지 않은 경우).
[root@kvm devicemapper]# stat -t data
data 107374182400 3887728 8180 0 0 fd01 559688 1 0 0 1633555816 1610128779 1610128779 0 4096
[root@kvm devicemapper]# stat --printf="%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %W %o\n" data
data 107374182400 3887728 8180 0 0 fd01 559688 1 0 0 1633555816 1610128779 1610128779 0 4096
(버전 8.22) 즉,
%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %W %o
%n file name
%s total size, in bytes
%b number of blocks allocated
%f raw mode in hex
%u user ID of owner
%g group ID of owner
%D device number in hex
%i inode number
%h number of hard links
%t major device type in hex, for character/block device special files
%T minor device type in hex, for character/block device special files
%X time of last access, seconds since Epoch
%Y time of last modification, seconds since Epoch
%Z time of last change, seconds since Epoch
%W time of file birth, seconds since Epoch; 0 if unknown
%o optimal I/O transfer size hint
최신 버전이 있다고 가정하면 stat
런타임에는 stat --help
terse에 해당하는 형식이 포함됩니다.