.TH STAT 1 .SH NAME stat \- print information about a file .SH SYNOPSIS .B stat [ .B -f .I format ] [ .B -9DL ] .I file [ .I file... ] .SH DESCRIPTION .PP .I Stat prints various bits of information about .I file based on a given .IR format , described below. The default format is \fL%t%n\fR, yielding the modification time and a newline. .PP .I Format is a string containing any number of data elements to print, each indicated by a .B % followed by a single character .IR verb , similar to a .IR 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. .PP The options .IR -9 , .IR -D , and .I -L are convenience shortcuts, equivalent to the formats of the same character followed by a newline in the case of .I -9 and .IR -L . .SH VERBS .SS Basic values .in 6m .ta 4m .ti2m \fL%a\fR Last access time; Dir->atime. .ti2m \fL%d\fR Device; Dir->dev. .ti2m \fL%g\fR Group; Dir->gid. .ti2m \fL%l\fR Size (length) in bytes; Dir->length. .ti2m \fL%m\fR Mode; access permissions and file attributes; Dir->mode. .ti2m \fL%M\fR User who last modified the file; Dir->muid. .ti2m \fL%n\fR A newline. .ti2m \fL%N\fR Name of the file; Dir->name. .ti2m \fL%o\fR Owner of the file; Dir->uid. .ti2m \fL%p\fR Qid path; Dir->qid.path. .ti2m \fL%q\fR Qid type, the file attributes in the top two bytes of Dir->mode; Dir->qid.type. .ti2m \fL%t\fR Last modification time; Dir->mtime. .ti2m \fL%T\fR Character representing the file server type; Dir->type. .br (Not to be confused with the .I type component of the Qid.) .ti2m \fL%v\fR Version of the file, per the Qid; Dir->qid.vers. .SS Composite values .in 6m .ta 4m .ti2m \fL%9\fR A composite output similar to that of \fL9p stat\fR from Plan 9 from User Space. .ti2m \fL%D\fR A verbose output of the full Dir structure. .ti2m \fL%L\fR A composite output similar to that of \fLls -l\fR, except that it leaves mode and time as their raw values. .ti2m \fL%Q\fR Qid; equivalent to .LR "%p %v %q" . .SS Character literals .in 6m .ta 4m .ti2m \fL%n\fR A newline. .ti2m \fL%_\fR A tab. .ti2m \fL%%\fR A %. .ti2m \fL% \fR (% followed by a space) A space. .SH BUGS It's frustrating that the literals aren't the same as .IR datefmt (1). .PP There exist some functions suitable for .IR fmtinstall (2) which we aren't using.