Parameters
[Drive:][Path] : Specifies the drive and directory for which you want to see a listing.
[FileName] : Specifies a particular file or group of files for which you want to see a listing.
/p : Displays one screen of the listing at a time. To see the next screen, press any key on the keyboard.
/q : Displays file ownership information.
/w : Displays the listing in wide format, with as many as five file names or directory names on each line.
/d : Same as /w but files are sorted by column.
/a [[:] attributes] : Displays only the names of those directories and files with the attributes you specify. If you omit /a, dir displays the names of all files except hidden and system files. If you use /a without specifying attributes, dir displays the names of all files, including hidden and system files. The following list describes each of the values you can use for attributes. The colon (

is optional. Use any combination of these values, and do not separate the values with spaces.
Value Description
h
Hidden files
s
System files
d
Directories
a
Files ready for archiving
r
Read-only files
-h
Files that are not hidden
-s
Files other than system files
-d
Files only (not directories)
-a
Files that have not changed since the last backup
-r
Files that are not read-only
/o [[:]SortOrder] : Controls the order in which dir sorts and displays directory names and file names. If you omit /o, dir displays the names in the order in which they occur in the directory. If you use /o without specifying SortOrder, dir displays the names of the directories, sorted in alphabetic order, and then displays the names of files, sorted in alphabetic order. The colon (

is optional. The following list describes each of the values you can use for SortOrder. Use any combination of the values, and do not separate these values with white spaces.
Value Description
n
In alphabetic order by name
e
In alphabetic order by extension
d
By date and time, earliest first
s
By size, smallest first
g
With directories grouped before files
-n
In reverse alphabetic order by name (Z through A)
-e
In reverse alphabetic order by extension (.ZZZ through .AAA)
-d
By date and time, latest first
-s
By size, largest first
-g
With directories grouped after files
/t [[:]TimeField] : Specifies which time field to display or use for sorting. The following list describes each of the values you can use for TimeField.
Value Description
c
Creation
a
Last access
w
Last written
/s : Lists every occurrence, in the specified directory and all subdirectories, of the specified file name.
/b : Lists each directory name or file name, one per line, including the file name extension. /b does not display heading information or a summary. /b overrides /w.
/l : Displays unsorted directory names and file names in lowercase. /l does not convert extended characters to lowercase.
/n : Displays a long list format with file names on the far right of the screen.
/x : Displays the short names generated for files on NTFS and FAT volumes. The display is the same as the display for /n, but short names are displayed after the long name.
/c : Displays the thousand separator in file sizes.
/4 : Displays four-digit year format.
/? : Displays help at the command prompt.