Shift
+ right click
on one file or multiple files
dir
command can be used to list the files from command prompt. This article explains the syntax for different usecases.
dir
command without any other arguments lists all the files/subfolders that exist in the current folder.dir
dir /b
This command prints the file names. No other file meta data like file modified time, file size etc are not displayed.
dir /s
dir
command accepts wild cards to display information only for the files that match the pattern specified. The below examples illustrate different use cases where we can use these wild cards
dir *.jpeg
To list all excel files
dir *.xls
We can even specify multiple extension in dir
command to list files of any of the types. To list all files created with Office applications like Word, Excel, Powerpoint etc we can run below command.
dir *.docx *.xlsx *.pptx
dir /S Picture-*
dir
command can list the file names and also the subfolders names. We can be selective and say that we want only names of the files to be listed or only the names of the subdirectories to be listed.
dir /A:D
dir /A:-D
We can filter out which files should be listed in the dir
command output based on read-only, system, hidden archive file attributes.
dir /A:R
dir /A:H
dir /A:-A
dir /A:-R
dir /A:-H
dir /A:-S
dir /Q
Example:
c:\>dir /Q 1.txt 05/03/2015 01:12 AM 151,906 BUILTIN\Administrators 1.txt
The above result of dir
indicates that file 1.txt is owned by Administrators group.
dir /TC
dir /TA
dir /TW