Instance: Lists all files (/s/b) under the current directory and subdirectories, excluding folders (/A:A)
Dir/s/b/a:a
The following information is for reference only
dir--Display Disk Directory command
1. Features: Displays the contents of the disk directory.
2. Type: Internal command
3. Format: DIR [Drive:][path][filename] [/a[[:]attributes]] [/b] [/C] [/d] [/l] [/n] [/o[[:]sortorder]] [/p] [Q] [r] [/S] ]timefield]] [/w] [/x] [/4]4.
Instructions for use
/A displays the file with the specified attributes.
Attribute D Directory R read-only file
H hidden file a file to be archived
S System file I no content index file
L resolution Point-prefix representing "no"
/b uses an empty format (no header information or summary).
/C Displays the thousand separator in the file size. This is the default value. Use/-c.
Disables the separator display.
/d is the same as wide, but the files are listed by column category.
/l in lowercase.
/n The New Long column table format, where the filename is on the far right.
/O lists files in sorted order.
Arrange order N by name (alphabetical) S by size (from small to large)
E by extension (alphabetic order) D by date/time (from)
G Group Directory Precedence-prefix for reverse order
/p pauses after each information screen.
/q Displays the file owner.
/r displays an alternate data stream for the file.
/S Displays the files in the specified directory and all subdirectories.
/T controls the time character fields that are displayed or used to classify.
Time period C creation time
A Last access time
W Last Write Time
/w with a wide list format.
/x appears as a short name resulting from a file name other than 8.3. Format is a format of/n.
The short name is inserted in front of the long name. If there is no short name, the position is
Displays white space.
/4 display year with four digits
You can preset the switch in the DIRCMD environment variable. By adding a prefix-(dash)
To replace the pre-set switch. For example,/-w.
Dir x:/a:d only shows all directories under X disk
Dir x:/a:-d only displays all the files under the X disk (this seems wrong.) Author note)
If the letter is not written, the current directory is assumed