NAME
stat – print information about a file

SYNOPSIS
stat [ –f format ] [ –9DL ] file [ file... ]

DESCRIPTION
Stat prints various bits of information about file based on a given format, described below. The default format is %t%n, yielding the modification time and a newline.
Format is a string containing any number of data elements to print, each indicated by a % followed by a single character verb, similar to a print(2) specification but with no flags. Each verb corresponds to either a single data element, such as the file modification time or group, a combination of them, or a literal character output. The verbs which produce literal character output are for convenience in environments where quoting is difficult or tedius; characters not preceeded by a % are otherwise passed through. Unrecognized verbs are ignored.
The options –9, –D, and –L are convenience shortcuts, equivalent to the formats of the same character followed by a newline in the case of –9 and –L.

VERBS


Basic values
%a      Last access time; Dir–>atime.
%d      Device; Dir–>dev.
%g      Group; Dir–>gid.
%l      Size (length) in bytes; Dir–>length.
%m      Mode; access permissions and file attributes; Dir–>mode.
%M      User who last modified the file; Dir–>muid.
%n      A newline.
%N      Name of the file; Dir–>name.
%o      Owner of the file; Dir–>uid.
%p      Qid path; Dir–>qid.path.
%q      Qid type, the file attributes in the top two bytes of Dir–>mode; Dir–>qid.type.
%t      Last modification time; Dir–>mtime.
%T      Character representing the file server type; Dir–>type.
(Not to be confused with the type component of the Qid.)
%v      Version of the file, per the Qid; Dir–>qid.vers.


Composite values
%9      A composite output similar to that of 9p stat from Plan 9 from User Space.
%D      A verbose output of the full Dir structure.
%L      A composite output similar to that of ls –l, except that it leaves mode and time as their raw values.
%Q      Qid; equivalent to %p %v %q.


Character literals
%n      A newline.
%_      A tab.
%%      A %.
%      (% followed by a space) A space.

BUGS
It's frustrating that the literals aren't the same as datefmt(1).
There exist some functions suitable for fmtinstall(2) which we aren't using.