command to list files in dos

dir – Lists all files and directories in the directory that you are currently in.
dir /p – It will display all files one page at a time.
dir /w- You can use this command to list just the files and directories going horizontally
dir /s /w /p – Llist all the files and directories in the current directory and the sub directories after that, in one
dir /s –   Lists the files in the directory that you are in and all sub directories after that directory
dir *.exe – The above command lists any file that ends with .exe.
dir >file.txt -Takes the output of dir and store  it to the file file.txt
dir /s |find “i” |more – List all directories, one screen page at a time, and see the number of files in each directory and the amount of space each occupies.
dir /ad  – List only the directories in the current directory.
page at a time.
dir /on-List the files in alphabetical order
dir /o-n- List the files in reverse alphabetical order.
Share

Leave a Reply

Your email address will not be published. Required fields are marked *