bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#81542: ['stat' command] Permission bits in octal not displayed in fo


From: Ricky Tigg
Subject: bug#81542: ['stat' command] Permission bits in octal not displayed in four-digit format when invoked with 'stat -c %a'
Date: Mon, 3 Aug 2026 13:44:06 +0300

coreutils v. 9.11

Hello. Permission bits in octal not displayed in four-digit format when
invoked with 'stat -c %a' unlike it does with 'stat' alone.

manual STAT(1)

"The valid format sequences for files (without --file-system):

 %a  permission bits in octal (see '#' and '0' printf flags)"

note: command filtered

$ stat /etc/{shadow,passwd}
 File: /etc/shadow
Access: (0000/----------)  Uid: (0/root)   Gid: (0/root)

 File: /etc/passwd
Access: (0644/-rw-r--r--)  Uid: (0/root)   Gid: (0/root)

Four-digit permission bits in octal.

$ stat -c '%a/%A %u/%U %g/%G %n' /etc/{shadow,passwd} | column -t
0/----------    0/root  0/root  /etc/shadow
644/-rw-r--r--  0/root  0/root  /etc/passwd

Not four-digit permission bits in octal. In the worse case it is not even
three-digit permission bits in octal.

Expected: Permission bits in octal displayed in four-digit format when
invoked with 'stat -c %a' like it does with 'stat' alone.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]