ZDIR
[/?]
[/A[+|-]drash]
[/S[+|-]drash]
[/O[[+|-]ANEDSG]]
[/T[acw]]
[/L [number]]
[/W [number]]
[/LOCALFORMAT]
[/UTC]
[/COLOUR]
[/MONO]
[/OLDSRCDIR[+|-]]
[/E/U/B/D/H/P/Q[+|-]]
Filespecs…
/?/A/S/E/U/Q/B/D/H/L/NNote: This option is present for backwards compatibility only. Its use should be avoided. In future releases of the ZDIR command this option will be removed, since the standard meaning for this option of simulate execution has no applicability to the ZDIR command. It is only present to ease the use of the ZDIR command as a replacement for the DIR command.
/O/PNote: This option is present for backwards compatibility only.
/TThe dates and times are displayed in the order that they are specified. The default is the same as if /TW had been used.
/W/X/MONO/COLOUR/LOCALFORMAT/UTC/OLDSRCDIRThe ZDIR command displays the directory entries of all files that match the given search wildcard specifications. If no wildcard specifications are supplied, the default is to display the entries in the current directory.
The ZDIR command first processes the contents of the CMD_ZDIR_INIT environment variable, if it has inherited one, as if it were a command tail, before processing any of the command tails that have been passed to it. This allows one to modify default options globally. (One can use command aliases or wrapper scripts to achieve the same effect.)
By default, the basename, last write time, size, attribute flags, and description (value of the .SUBJECT extended attribute) of the file are displayed. Only up to 12 characters of the basename are displayed. If the base name is longer than 12 characters, its first 12 characters are printed followed by a triangle character.
If ZDIR detects that its standard output is neither a pipe nor a file, it will wrap the description onto multiple lines. Otherwise, it will output the description on a single line.
If the /P option is specified, ZDIR will pipe its standard output and standard error through a pager command. The pager command is specified by the contents of the PAGER environment variable. If there is no PAGER environment variable, the MORE command is used as the default pager command.
ZDIR invokes the pager command indirectly, by passing it as an argument to the command interpreter given by the COMSPEC environment variable (defaulting to "CMD" if that environment variable does not exist). So, for example, the pager command could be a command script, or a built-in command, or a command pipeline.
If ZDIR detects that its standard output is neither a pipe nor a file, it will send escape sequences to its standard output to change the colour of directory entries as specified in the DIR_COLOURS environment variable. This can be overridden by using the /MONO and /COLOUR options, to explicitly force or prevent the use of these escape sequences respectively.
ZDIR matches the colouring rules using the base part of the filename and the file's attributes, and applies each rule in order until one matches. If none of the colouring rules in the DIR_COLOURS environment variable match a file, or if the DIR_COLOURS environment variable does not exist, ZDIR will send escape sequences to change to white on black. To override this, append a colouring rule with "*" as its wildcard specification to the end of the DIR_COLOURS environment variable.
If colouring is used, ZDIR will change to white on black at the end of each directory entry displayed. It will do this before sending the newline sequence in order to prevent unsightly results if the screen happens to scroll up when the newline is sent.