Name

dir

Synopsis

dir [options] [path]

Display directory contents. path defaults to the current directory.

Options

Options may be set in the DIRCMD environment variable, and may be overridden by including the option on the command line, preceded by a minus sign (e.g., /-N).

/B

Display filenames only, one per line (omit the header line).

/W | /D

Wide directory listing: display several filenames per output line, ordering them by row or column, respectively.

/Q

Display file owners.

/N

Display Unix-style long directory listing (filenames appear on the right).

/L

Display all filenames in lowercase.

/X

Show 8.3 filenames in addition to long filenames.

/S

Recurse subdirectories.

/O: sort-order

Specify ordering of displayed files, using the following codes: N (by name), E (by extension), S (by size), D (date and time), and G (list directories first). To reverse the usual sort order, precede any code letter with a minus sign .

/T: timecode

Select which time to display and use for sorting: C (creation time), A (access time), or W (modification time, which is the default).

/A:codes

Select only files with specified attributes: D for directories, H for hidden, S for system, R for read-only, and A for archive. A minus sign before a code letter indicates that files of that particular type are to be excluded.

/C | /-C

Include/omit commas from file sizes. (The default is to include them.)

/4

Display years in four digits.

/P

Pause after each output screen.

Get Windows 2000 Commands Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.