Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

First, the format of the DIR command


May 22, 2021 DOS Command learning manual



dir [D:][PATH][NAME][[/A][:attrib]][/o:[sorted][/s][/l][/c[h]


(1) dir /a:attrib default contains all files (system files. I mplied file)


Attrib.


Only read-only or non-read-only files are displayed


Only system files or non-system files are displayed


Only files to be archived or non-archived are displayed


(2)/o.:) Sorted: By default, it is entirely alphabetical, with subdirections appearing before the file


/o(n/-n): displayed in alphabetical order or in reverse order of file names


e/-e: Alphabetical/reverse display by extension


d/-d: Displayed in chronological/reverse order


s/-s: Displayed from large to small or/in reverse by size


g/-g: Press subdirectdirected before file or file before subdirectdirect


(3)/s parameter: A list of all files in the current directory and its subdirectts


Column ir /s/a/o:n c:?gt;PRN


Print all subdirectts and files on the c disk as affiliation and in alphabetical order based on the subdirectdirects and files


(4) /B parameter: Only the file name and extension will be displayed


(5) /L parameter: All files or subdirectdirectations will be listed in lowercase letters


Training:


All files in the current directory of the dir /a column (implied and system files)


The dir /ah column implies a file (containing subdirectts (implied) dir /a-h


dir /as column system file dir /a-s


Dir /ad column subdirecte dir /a-d


dir /o in alphabetical order


Dir /B shows only the file name and extension


Application:

List all file directories and sub-files in a disk directory into one text file.

dir /s >> h:\dx.txt