windows command(5):TYPE

TYPE命令用于显示文件内容,相当于bash的cat命令。

显示文件内容 TYPE filename

display file content
1
2
3
D:\test>type hello.txt
hello
this is a test file.

合并文件

直接合并 TYPE file1 file2 > mergefile

merge files
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
D:\test>type a.txt
i am a
D:\test>type hello.txt
hello
this is a test file.
D:\test>type a.txt hello.txt >new.txt
a.txt
hello.txt
D:\test>type new.txt
i am a
hello
this is a test file.

多次合并 type file >> mergefile

merge files
1
2
type fileA.jpg >> file.jpg
type fileB.rar >> file.jpg

Refrenece:

help
1
2
3
显示文本文件的内容。
TYPE [drive:][path]filename