Displays a directory file listing.
dir [drive:][path][filename] [...] [/p] [/q] [/w] [/d] [/a[[:]attributes]][/o[[:]sortorder]] [/t[[:]timefield]] [/s] [/b] [/l] [/n] [/x] [/c] [/4]
| Parameters | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| | |||||||||||||||||||||
| Parameter | Purpose | ||||||||||||||||||||
| | |||||||||||||||||||||
| None | Displays the disk's volume label, serial number, and a listing of its contents. | ||||||||||||||||||||
| [drive:][path] | Specifies the drive and path for the folder to be displayed. | ||||||||||||||||||||
| [filename] | Specifies a particular file to be displayed. | ||||||||||||||||||||
| [/p] | Displays data a screen at a time. | ||||||||||||||||||||
| [/q] | Display information about file ownership. | ||||||||||||||||||||
| [/w] | Displays the folder listing in multiple columns. | ||||||||||||||||||||
| [/d] | Same as /w but sorts files by column. | ||||||||||||||||||||
| /a[[:] attributes] | Limits the displays to directories and files that match supplied attributes. The following attributes can be used:
| ||||||||||||||||||||
| /o [[:]sortorder] | Specifies the sort order used to display directory and file names. The following options can be used:
| ||||||||||||||||||||
| /t [[:]timefield] | Determines the time field used to display or sorting the listing. Valid options:
| ||||||||||||||||||||
| [/s] | Lists every occurrence of the specified file name. | ||||||||||||||||||||
| [/b] | Lists each directory or file name. | ||||||||||||||||||||
| [/l] | Displays unsorted lowercase folder and file names. | ||||||||||||||||||||
| [/n] | Displays a long list format. | ||||||||||||||||||||
| [/x] | Displays the short names. | ||||||||||||||||||||
| [/c] | Displays the thousand separator (comma) when showing file sizes. | ||||||||||||||||||||
| [/4] | Displays the date in a four-digit year format. | ||||||||||||||||||||