TYPE (DOS command)
| Company type | Command |
|---|---|
| Industry | Computing / Software |
| Founded | 1980s |
| Founder | Tim Paterson |
| Products | File content display utility in various command-line interpreters |
In computing, the type command is utilized in a variety of command-line interpreters (shells) such as COMMAND.COM, cmd.exe, 4DOS/4NT, and Windows PowerShell to output the content of designated files directly onto the computer terminal. Its equivalent in Unix systems is .
Implementations
The type utility is supported by a broad range of operating systems, including those developed by DEC like RT-11, OS/8, RSX-11, TOPS-10, and TOPS-20, as well as VMS. It is also present in Digital Research operating systems such as CP/M, MP/M, and MetaComCo’s TRIPOS, alongside systems like Heath Company’s HDOS, AmigaDOS, various versions of DOS, FlexOS, PC-MOS, SpartaDOS X, IBM/Toshiba’s 4690 OS, IBM’s OS/2, Microsoft Windows, and open-source platforms like ReactOS, AROS, and SymbOS.
Initially introduced by Tim Paterson for Seattle Computer Products’ 86-DOS, the type command has been incorporated into MS-DOS starting from its first release. It is also implemented in DR DOS 6.0, various open-source MS-DOS emulators including DOSBox, and the EFI shell.
Within Windows PowerShell, type functions as a predefined alias for the cmdlet, preserving comparable behavior. Although it originated as an internal command in 86-DOS, its syntax and capabilities differ depending on the operating system and shell environment.
DEC RT-11
On the Digital Equipment Corporation platform RT-11, this command can process up to six file specifications at once, separated by commas. The default file extension assumed is .LST, and the command supports filename and filetype patterns using wildcards.
Syntax
TYPE[/options] filespecs
COPIES:n– Specifies how many times to output the fileDELETE– Removes the file after displaying itLOG– Records the names of typed filesNEWFILES– Outputs only files with the current system dateNOLOG– Prevents logging activityQUERY– Prompts for confirmation before each file is displayedWAIT– Pauses for user input before proceeding
Examples
TYPE/COPIES:3 REPORT
TYPE/NEWFILES *.LST
DR CP/M, MP/M, FlexOS
In Digital Research’s CP/M environment, the command expands tab characters and line feeds, assuming tab stops set every eight columns. However, wildcard characters are not supported in FlexOS for this command.
Syntax
TYPE ufn
(Note: ufn stands for unambiguous file reference)
For MP/M, a pause feature is enabled by appending 'P' followed by two digits after the filename; this pauses output after displaying that number of lines until a key is pressed.
Examples
<syntaxhighlight lang="doscon"> A>TYPE FILE.PLM </syntaxhighlight>
<syntaxhighlight lang="doscon"> A>TYPE B:X.PRN </syntaxhighlight>
<syntaxhighlight lang="doscon"> 0A>TYPE CODE.ASM P23 </syntaxhighlight>
TSL PC-MOS
The Software Link's PC-MOS/386 operating system includes a TYPE command distributed under the terms of the GPL v3. This implementation offers an option to display file contents in hexadecimal format.
Syntax
.TYPE filename [/h]
filename– Specifies the file to be displayed/h– Outputs the file content in hexadecimal format
Examples
<syntaxhighlight lang="doscon"> [A:\].TYPE FILE.BIN /h </syntaxhighlight>
Microsoft Windows, OS/2, ReactOS
This command accepts wildcard characters. When used in Microsoft Windows and OS/2, it shows filenames in the output if multiple files are specified.
Syntax
On Microsoft Windows and ReactOS, the command syntax is as follows:
type [Drive:][Path]FileName
[Drive:][Path]FileName– Indicates the path and name of the file(s) to be displayed. Separate multiple files with spaces./?– Provides help information about the command.
Examples
<syntaxhighlight lang="doscon"> C:\>type "my report.txt" </syntaxhighlight>
<syntaxhighlight lang="doscon"> C:\>type *.txt </syntaxhighlight>