This command displays the list of the files, directories and subdirectories that are contained in the current directory, if used without an argument. If any argument is passed the contents of that directory will be displayed.
Syntax
DIR [ path ] [ filename ]
Where path and filename are optional fields that specify the drive, directory and / or files to list.
To use this command type "dir" at the command prompt and press enter and you will see a listing of the current files in the directory you are in, including information about their file sizes, date and time they were last written to.This command will also display the amount of space the files in the directory are using and also the total amount of free disk space that is available on the current hard drive.
Example: Typing dir *.txt will only list those files that have the extension .txt. ![]()











