Command library / type
type
Print a file's contents to the screen
The CMD equivalent of reading a file straight to the screen — the same job bash's cat does. Give it more than one file and it prints them one after another, each preceded by its own name.
Practice typeUsage
type file...
Options and flags
fileone or more files to print
Examples
type C:\Windows\System32\drivers\etc\hostsPrint the Windows hosts file.
type app.log error.logPrint both files, each labeled with its own filename first.
type "C:\Program Files\Acme\config.ini"A path with a space must be quoted, or CMD reads it as two separate files.
Common mistakes
type type C:\Windows\System32\drivers\etc\hosts
type always needs at least one file — without one there's nothing to print.
type C:\Program Files\Acme\config.ini type "C:\Program Files\Acme\config.ini"
CMD splits unquoted arguments at spaces, so this asks for two files: C:\Program and Files\Acme\config.ini.