Type - DOS/Command Prompt Reference
Outputs content of specified file (to standard output).
Syntax
type <file-name>
Options
- <file-name>
- Specifies the file path to output.
Details
Type command outputs text-based file content as-is. If the file contains EOF character (0x1A; Ctrl+Z), Type prints the content up to its character. In fact Type treats any files as text file, so please note that specifying binary files (such as image files) may cause outputting garbled characters or slow output.
You can also specify device file names, such as CON and AUX.
Samples
Sample 1
type C:\CONFIG.SYS
Shows the content of file ‘C:\CONFIG.SYS’.
Sample 2
type setup.txt | more
By using pipe ‘|’, send the ‘setup.txt’ content to More command. This enables to display ‘setup.txt’ content per screen.
Sample 3
type NUL > hello.txt
Creates ‘hello.txt’ as an empty file.
[MS-DOS, Windows 95/98/Me] You can create an empty file by using this syntax, whereas you cannot by using Copy command.
Sample 4
type CON > hello.txt
Writes text input at the prompt to the file ‘hello.txt’. To finish input, enter EOF character (press Ctrl+Z and Enter).
[MS-DOS, Windows 95/98/Me] Unlike using Copy command, you can create a 0 bytes (empty) file.