Each of the command options and switches is listed in our DOS command overview. This switch is useful to see all the files and directories in a directory with dozens or hundreds of files. For example, with the dir command, you can type dir /p to list the files and directories in the current directory one page at a time.
In the example below, there are 0 files listed and 14 directories, indicated by the status message at the bottom of the output.Įvery command in the command line has options, which are additional switches and commands that can be added after the command. As shown, you are given lots of useful information including the creation date and time, directories (), and the name of the directory or file. Without using any dir options, this is how dir output appears. You should get an output similar to the example image below. Type dir at the prompt to list files in the current directory. For example, dir /? would give the options available for the dir command. If you need help with any of command, type /? after the command.When a file or directory is deleted in the command line, it is not moved into the Recycle Bin.File names can have a long file name of 255 characters and a three character file extension.For example, the directory My Documents would be "My Documents" when typed. When working with a file or directory with a space, surround it in quotes.
If you need additional information or alternative methods for all versions of Windows, see: How to get to an MS-DOS prompt or Windows command line. Open a Windows command line window by following the steps below. If you are interested in learning about the command line in more detail, see our DOS and command prompt overview, which gives a description and example for every command. Keep in mind that there are over 100 different commands used in MS-DOS and the Windows command line. On this page, you learn how to move around in the command line, find files, manipulate files, and other important commands. If, for example, the file we were looking for was mybob.txt, looking above, we see that this file is in the C:\Windows directory.This page covers the basics of navigating and using the Microsoft Windows command line. Using /p displays the results one page at a time. If you receive more than expected results, you may need to type /p after the command. MORBOB~1 PCX 25,798 01-09-98 4:24a morboBASE.pcxĭirectory of C:\Windows MYBOB TXT 4 11-19-00 3:23p mybob.txtĪs you can see in the above example, several files were found that contain bob. GENMSBOB HTM 2,592 12-19-96 7:01p genmsbob.htmĭirectory of C:\Games\chessmaster\Personalitiesĭirectory of C:\Games\Quake 2\baseq2\players1\Morbo
How to change a directory or open a folder.īelow is an example of the results found when typing dir *bob*.* /s as mentioned in an earlier example.If you don't know extension of your file, you can find a listing of the majority of extensions and the associated program on our MS-DOS extensions page.įinally, once you have found the file, you must interpret the output of your search and be able to change directories to get to that file. xls file extension, we use the wild character, telling the computer to search for any file ending with the. In the above example, knowing Excel files often end with the. If you cannot recall any of the names of the files but recall that they were created in Microsoft Excel you could, for example, type: dir *.xls /s Also, it uses the /s command switch to tell the dir command to search the current directory, and all its subdirectories. The above example uses wildcards (the asterisks).
If, for example, you knew that the file had bob somewhere in the file, you would type: dir *bob*.* /s Once at the root directory or the directory you believe the file to be in, type any of the following commands. Meaning, you must be at C:\> to get to this prompt, type the following command. If you are unsure where the file may be on the computer, you must be at the root directory of the computer. You can find any file on your computer using MS-DOS providing you know the name of the file or the program that created the file.