type command (Windows / CMD)
What it does
Display the contents of one or more text files. Searches for the type command cmd file contents usually need CMD syntax, practical switches, and notes on how it compares with PowerShell or Linux alternatives. This page covers syntax, common options, and copyable examples for Command Prompt.
Display the contents of one or more text files.
Syntax
type [drive:][path]filename [...]
Common options
| Flag / option | Meaning |
|---|---|
| filename | Select a file to display. |
| file1 file2 | Display multiple files in sequence. |
| > file | Redirect displayed content to another file. |
Practical examples
Read file
type README.txt
Writes the text file to the console.
Combine display
type header.txt body.txt
Displays both files in argument order.
Send to pager
type large.log | more
Pages through a long text file.
Linux ↔ Windows equivalent
Closest match: cat (Linux / bash / sh / zsh). Concatenate files and write their contents to standard output.
Common mistakes
- Using type on binary data and producing unreadable terminal output.
- Redirecting back to the same input file and truncating it.
Related commands
- findstrSearch files or piped text using literal strings or regular expressions.
- Get-ContentRead file content or provider data as a stream of objects.
- echoDisplay text or control command echoing in a batch script.
- grepSearch text for lines matching a pattern.
- Where-ObjectFilter pipeline objects by property values or a script block predicate.
- catConcatenate files and write their contents to standard output.
- echoWrite arguments and shell-expanded values to standard output.
- tailPrint the end of input and optionally follow appended data.
FAQ
What does type do in Command Prompt?
Display the contents of one or more text files.
How do I run type in CMD?
Open Command Prompt and follow `type [drive:][path]filename [...]`; quote paths containing spaces.
What is a practical type example in CMD?
Try `type README.txt` — Writes the text file to the console.
Can type be used in a batch file?
Yes. Check its exit code and escape CMD metacharacters when input is variable.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.