type
嚯嚯 发表于 2020-06-22 17:50浏览次数:
type命令可以显示文本文件的内容。但是,它不允许您编辑文件或添加新文本。要编辑文件文本,请改用记事本。或者,要将文本从命令提示符追加到新文件或现有文件中,可以使用copy con。
The type command displays the contents of a text file. However, it does not allow you to edit the file, or add new text. To edit a text a file, use Notepad instead. Or, to append text to a new or existing file from the command prompt, you can use copy con.
目录:
1 type 运行系统环境
2 type 语法
3 type 示例
type 运行系统环境
Windows 95
Windows 98
Windows xp
Windows vista
Windows 2000
Windows 7
Windows 8
Windows 10
Windows NT
Windows ME
All Versions of MS-DOS
type 语法
type [Drive:][Path]FileName
该type 的命令没有选项。
FileName是要显示的文件的名称。
如果未指定Path,则文件必须存在于当前目录中。如果未指定驱动器,则该文件必须存在于当前磁盘驱动器上。
type [Drive:][Path]FileName
The type command has no options.
FileName is the name of the file to show.
If no Path is specified, the file must exist in the current directory. If no Drive is specified, the file must exist on the current disk drive.
type 示例
type c:\autoexec.bat
显示文件C:\ autoexec.bat的内容(如果存在)。
type myfile.txt
显示myfile.txt的内容(如果当前目录中存在)。
type "My file.txt"
在此命令中,文件名包含一个空格,因此将其括在双引号中。
type "C:\Users\Jeff\Desktop\My files\My notes.txt" | more
显示文件C:\ Users \ Jeff \ Desktop \ My files \ My notes.txt的内容。此处,将type命令通过管道(|)传递到more命令,该命令在每个输出屏幕之后暂停显示,从而使查看长文件更加容易。
type c:\autoexec.bat
Display the contents of the file C:\autoexec.bat, if it exists.
type myfile.txt
Display the contents of myfile.txt, if it exists in the current directory.
type "My file.txt"
In this command, the file name contains a space, so it is enclosed in double-quotes.
type "C:\Users\Jeff\Desktop\My files\My notes.txt" | more
Display the contents of the file C:\Users\Jeff\Desktop\My files\My notes.txt. Here, the type command is piped ( | ) to the more command that pauses the display after each screen of output, making it easier to view long files.