Home > Commands N-Z > Commands T

TYPE


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Displays the contents of a text file.

Use the TYPE command to view a text file without modifying it.


Syntax

TYPE /?

TYPE [drive:][path]filename [/P]


Parameters
drive: ( filename v1.0)
drive: path filename (v2.0 Win95)
Specifies the location and name of the file that you want to view.
drive: path filename(s) (NT3.5)
If more than one file is specified the filenames are included in the output. If a wildcard is used the filenames are not displayed.

Switches
/? (NTXP)
Displays help.
/P (PCDOS1.85 ONLY)
Pause screen.

Related

For information about displaying filenames and file sizes, see the DIR command.
For information about displaying text files one screen at a time, see the MORE command.
FOR /F
SORT
Equivalent Linux BASH commands:
cat - Display the contents of a file.


Notes
Displaying binary files

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


Examples

If you want to display the contents of a file named HOLIDAY.MAR, type:

    TYPE HOLIDAY.MAR

If the file you want to display is long, you can use the MORE command along with TYPE, as shown in the command, to display the file's contents one screen at a time:

    TYPE HOLIDAY.MAR | MORE

Before using a pipe (|) for redirection, you should set the %TEMP% environment variable in your AUTOEXEC.BAT file.


Errorlevels

none.


Availability
Internal
DOS
v1.0 v1.05 v1.1 v1.11 v1.24 v1.25 v1.85 v2.0 v2.01 v2.05 v2.10 v2.11 v2.11R v2.12 v2.2 v2.25 v3.0 v3.20 v3.05 v3.1 v3.21 v3.25 v3.30 v3.3A v3.3R v3.3T v3.31 v3.40 v4.0 v4.01 v4.01A v5.0 v5.0A v5.00.02 v5.001A v5.01 v5.02 v6.0 v6.10 v6.2 v6.21 v6.22 v6.23 v7.00 v7.0R1 v7.10 v8.00
Windows
Win95 Win98 WinME
Windows NT
NT3.5 NT4 NT2000 NTXP NT2003