Displaying Files in a Folder: DIR command

 

The DIR (directory) command is used to display the names of files in a given folder (or directory)

 

1Press F9 to access the action line
2Type dir d:\path to obtain the directory you wish to view.  If you leave out the path you will obtain a directory of the current directory.
3Press F10 to display the directory.

There are several switches available.  You can substitute any of the following for dir in step 2.

 

dir/na to display filenames and subdirectory names only
dir/fi  to display filenames and file information only
dir/pa to display subdirectory names only
dir/su to display file summary information
dir/na/fi to display a list of filenames only
dir/na/pa to display a list of subdirectories in the current directory and append a list of available drives

 

It is also possible to obtain a partial list of files by using global names.  Wild card characters may be used to search, for example, for all files with the same extension (*.doc).  You can use most of the same wild card characters when searching for text.

 

NB:

Whenever the dir command is executed you get a list current to that moment.
Long filenames will be shortened to 8 letters or less with a 3 letter extension.
Directories may be saved or printed.
Directories may be sorted by extension, date, path or reverse order
Click Tools, Preferences, highlight directories and click Set to change how directories are displayed.

 

 

See also:

Displaying Folders and Filenames

Sorting Files in a Folder  

Managing Files from Windows Explorer

Managing Files from Open File Dialog