Skip to main content

Command referencetype

type command (Windows / CMD)

WindowsCMDtextbeginner

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 / optionMeaning
filenameSelect a file to display.
file1 file2Display multiple files in sequence.
> fileRedirect 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.

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.