1. dir - Lists all files and directories in the current directory. By default the dir command lists the files and directories in alphabetic order.
2. dir *.exe - The above command lists any file that ends with the .exe file extension. See the wildcarddefinition for further wildcard examples.
3. dir *.txt *.doc - The above is using multiple filespecs to list any files ending with .txt and .doc in one command.
4. dir /ad - List only the directories in the current directory. If you need to move into one of the directories listed use the cd command.
5. dir /s - Lists the files in the directory that you are in and all sub directories after that directory, if you are at root "C:\>" and type this command this will list to you every file and directory on the C: drive of the computer.
6. dir /p - If the directory has lots of files and you cannot read all the files as they scroll by, you can use this command and it displays all files one page at a time.
7.dir /w - If you don't need file information you can use this command to list only the files and directories going horizontally, taking as little as space needed.
8. dir /s /w /p - This would list all the files and directories in the current directory and the sub directories after that, in wide format and one page at a time.
9. dir /on - List the files in reverse alphabetical order by the names of the files.
10. dir \ /s |find "i" |more - A nice command to list all directories on the hard drive, one screen page at a time, and see the number of files in each directory and the amount of space each occupies.
11. dir > myfile.txt - Takes the output of dir and re-routes it to the file myfile.txt instead of outputting it to the screen.