Name

dir

Synopsis

Without any options, dir displays the disk's volume label and serial number, a list of all files and subdirectories in the current directory, file/directory size, date/time of last modification, long filename, the total number of files listed, their cumulative size, and the free space (in bytes) remaining on the disk. If you specify one or more file or directory names (* and ? wildcards are supported), information only for those files or directories will be listed. dir accepts the following options:

dir [filename] [/b] [/c] [/d] [/l] [/n] [/p] [/q] [/s] 
   [/w] [/x] [/4] [/a:attributes] [/o:sortorder] 
   [/t:timefield]

Option

Description

/a: attributes

Display only files with/without specified attributes (using - as a prefix specifies "not," and a colon between the option and attribute is optional).

/b

Use bare format (no heading information or summary). Use with /s to find a filename.

/c

Display compression ratio of files on Dblspace or DrvSpace drives, assuming 16 sectors per cluster.

/d

Same as /w, except files are sorted vertically.

/l

Use lowercase.

/n

List files in a "new" Unix-like display, where filenames are shown on the right.

/o: sortorder

List files in sorted order (using - as a prefix reverses the order, and a colon between the option and attribute is optional): d = date and time (earliest first), e = alphabetically by extension, g = group directories first , n = alphabetically by name, s = size (smallest first).

/p

Get Windows XP 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.