DOS Files

2008 Oct 18


File Names
Filenames and pathnames:
   drive:\path1\path2\...\filename.ext

Wildcards: (allowed in some commands)
   * : matches zero or more characters
   ? : matches any one character

Legal filename.ext characters:
   a..z A..Z _ 0..9 & @ ^ _ { } $ ! # ( ) ' ` ~ % -
drive: Represents drive letter (colon is required)
path1,path2 Represents the subdirectories
filename Represents the 1-8 (or more) character name of the file
.ext Represents the 0-3 (or more) character file extension
... An ellipses indicates preceeding parameter can be
repeated one or more times

Note: the case of a letter in a file name does not matter in
DOS and Windows (unlike unix/linux where it does matter).


Input/Output Redirection (DOS 2.0 and later)
> Sends stdout to a named file, overwriting if it exists
>> Appends stdout to a named file, creating if it does not exist
< Redirects stdin from keyboard to read a file
| Pipes stdout from command on left to stdin of command on right
DOS Reserved Names
AUX The primary serial port (usually COM1).
COMx The serial ports.
CON The standard device for input and output
(normally the keyboard on input and the video display for output).
LPTx The printer (parallel) ports (e.g. LPT1).
NUL The null device; the computer ignores everything written to it.
PRN The primary printer port (usually LPT1).

2005-2008