Dir command can be used to list the files from command prompt. Let’s see different options available with this command.
dir
A simple dir command without any other arguments lists all the files/subfolders that exist in the current folder.
dir /b
Lists the subfolders/files names in bare format. Just the names will be displayed and no other information (like file modified time, file size etc) will be shown.
dir /s
List the files in the current folder and also the ones in the subfolders recursively.
Dir /A:D
Display only directories.
Dir /A:R
Display only Read-only files.
Dir /A:H
Display only hidden files
Dir /A:A
List only the files that have archive attribute set.
Dir /A:S
List only system files
Dir /A:-D
Exclude directories from the listing and display all other files.
Dir /A:-R
Exclude Read-only files from the listing.
Dir /A:-H
Exclude hidden files from listing.
Dir /A:-A
Exclude files that have archive attribute set.
Dir /A:-S
Exclude system files from listing
Dir /Q
Same as Dir but also displays the owner of the file.
Dir /TC
Same as Dir but prints Created time for each file
Dir /TA
Same as Dir but prints Last accessed time for each file.
Dir /TW
Same as Dir but prints last modified time for each file.
{ 0 comments… add one now }