A-Z List


Type

Updated: April 17, 2012

Applies To: Windows 7, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP

Displays the contents of a text file. Use the type command to view a text file without modifying it.

For examples of how to use this command, see Examples.

Syntax

type [<Drive>:][<Path>]<FileName>
Parameters

 

Parameter Description

[<Drive>:][<Path>]<FileName>

Specifies the location and name of the file or files that you want to view. Separate multiple file names with spaces.

/?

Displays help at the command prompt.

Remarks

  • If FileName contains spaces, enclose it in quotation marks (for example, "File Name Containing Spaces.txt").

  • If you display a binary file or a file that is created by a program, you may see strange characters on the screen, including formfeed characters and escape-sequence symbols. These characters represent control codes that are used in the binary file. In general, avoid using the type command to display binary files.

Examples

To display the contents of a file named Holiday.mar, type:

type holiday.mar 

To display the contents of a lengthy file named Holiday.mar one screen at a time, type:

type holiday.mar | more 
Additional references

Command-Line Syntax Key

Tags :


Community Content

Drewfus
Handles 3-9 more appropriate for filenames
<p>Peter Smith in Redmond is correct - when using wildcard for filename parameter, filenames are printed via stderr stream.<br /><br />Redirecting stderr to the nul device suppresses the display of filenames;<br /><br /></p> <pre>type *.txt 2&gt;nul</pre> <p> <br />Sdterr stream is via handle 2. Handles 3-9 are available - why not use one of those instead?<br /><br /><mtps:InstrumentedLink NavigateUrl="http://technet.microsoft.com/en-us/library/bb490982.aspx" runat="server" xmlns:mtps="http://msdn2.microsoft.com/mtps">http://technet.microsoft.com/en-us/library/bb490982.aspx</mtps:InstrumentedLink><br /></p>
Tags :

Peter Smith in Redmond
Type prints out the the file being type'd to stderr
The 'type' command, when given a wildcard specifier, will print out all of the matching files. As each file is typed, the corresponding file name is printed. That file name is printed out to stderr (even though it's not an error at all).
Tags : doc:

Page view tracker