|
xihaha
初级用户
 
积分 148
发帖 12
注册 2004-7-17
状态 离线
|
『楼 主』:
DOS下怎么建立文件
使用 LLM 解释/回答一下
要建立文件用什么命令,请教了
What command is used to create a file? I'm asking for advice.
|
|
2004-7-21 00:00 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
DOS下建立目录是用md命令,你肯定是想问有没有一个命令是用来建立文件的,就好象windows下的新建文本文件(或者新建Word文件)这样的功能。说起来,DOS下还真没有这样的命令,但DOS下建立新文件的方式有很多,例如,你可以复制一个别的文件过来(copy),也可以用Edit命令编辑一个文件然后保存起来,也可以用dir > newfile.ext的管道方式建立文件,总之,DOS下建立文件要先确定文件的内容(哪怕是空的),然后才能保存成一个文件,这点儿不同于Windows,Windows下你可以先建立一个空的文件然后再输入内容。而DOS下却是先有内容才有文件的。
In DOS, the command to create a directory is the `md` command. You must be asking if there is a command used to create a file, just like the function of creating a new text file (or a new Word file) in Windows. Well, actually, there isn't such a command in DOS. But there are many ways to create a new file in DOS. For example, you can copy another file over (using `copy`), or you can use the Edit command to edit a file and then save it, or you can use the pipe method like `dir > newfile.ext` to create a file. In short, in DOS, to create a new file, you need to determine the content of the file first (even if it's empty), and then you can save it as a file. This is different from Windows. In Windows, you can first create an empty file and then enter content, but in DOS, you have content first and then the file.
|

偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
|
|
2004-7-21 00:00 |
|
|
xihaha
初级用户
 
积分 148
发帖 12
注册 2004-7-17
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
是这个意思,看了有启发,谢谢另外再请教一下,是不是COPY任何一个文件,如EXE,BAT,TXT等,都可以进行EDIT,然后再保存为自己需要的文件类型,如EXE保存为TXT?
That's the meaning. I got inspiration after reading it. Thanks. Also, I would like to ask: Can you edit any file, such as EXE, BAT, TXT, etc. by COPY, and then save it as the file type you need, like saving an EXE as TXT?
|
|
2004-7-21 00:00 |
|
|
nre
银牌会员
     nre
积分 1210
发帖 361
注册 2002-12-28
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
这个不行,文件名只是个标识,此文件到底是什么类型取决于文件本身的内容。 就像人的名字一样,无论怎么改名字这个人的属性却根本没变。
This doesn't work. The file name is just an identifier. What type this file actually is depends on the content of the file itself. Just like a person's name, no matter how you change the name, the person's attributes don't change at all.
|

Teamwork ! |
|
2004-7-21 00:00 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
文件分文本文件和二进制文件两种,文本文件可以copy过来后再Edit,但二进制的文件虽然可以用Edit打开,但内容却都是乱码,原则上是无法进行编辑的。正如楼上所说,文件名是操作计算机的人给命名的,但文件的内容却不会随着文件名的变化而变化。我们需要按照文件的内容给文件起适当的名字,却不能想象让文件内容随着名字的变化而变化。
Files are divided into two types: text files and binary files. Text files can be copied over and then edited with Edit, but although binary files can be opened with Edit, the content is all garbled and cannot be edited in principle. As the person upstairs said, filenames are named by the people operating the computer, but the content of the file does not change with the change of the filename. We need to give appropriate names to files according to their content, but we cannot imagine that the content of the file changes with the change of the name.
|

偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
|
|
2004-7-21 00:00 |
|
|
xihaha
初级用户
 
积分 148
发帖 12
注册 2004-7-17
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
谢谢了。我的意思是,比如想建立一个文本文件,COPY一个EXE文件,把它的内容全部删除,输入文本,这样是不是就成了一个文本文件了?如果想自建一个HELP文件,该怎么建?因为我的98启动盘没有这个文件,也没有这个类型。dir > newfile.ext管道建立文件是怎么操作的,怎么定义文件类型的,能讲解一下吗?
Thanks. I mean, for example, if you want to create a text file, COPY an EXE file, delete all its contents, and enter text, then is it just a text file? If you want to create a HELP file by yourself, how to create it? Because my 98 boot disk doesn't have this file, and there's no such type. How to operate the dir > newfile.ext pipeline to create a file, and how to define the file type, can you explain it?
|
|
2004-7-22 00:00 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
原理上可以这样,但完全没有必要如此麻烦,直接用Edit输入你要建立的文本文件的内容,然后保存就行了,这就好象用记事本直接输入文件内容再保存一样。关于管道操作,建议你好好学习一下DOS的基础知识。
In principle, it can be like this, but there is absolutely no need to be so troublesome. Just use Edit to enter the content of the text file you want to create and then save it. It's just like directly using Notepad to enter the file content and then save it. Regarding pipeline operations, it is recommended that you study the basic knowledge of DOS carefully.
|

偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
|
|
2004-7-22 00:00 |
|
|
xihaha
初级用户
 
积分 148
发帖 12
注册 2004-7-17
状态 离线
|
|
2004-7-22 00:00 |
|
|
lwha
新手上路

积分 2
发帖 1
注册 2009-10-19
状态 离线
|
『第 9 楼』:
用管道命令
使用 LLM 解释/回答一下
种类比较多
1.------------------------------------
cd.>c:\新建1.txt
rem.>c:\新建1.txt
type nul>c:\新建1.txt
2.------------------------------------
c:>c:\新建1.txt
3.------------------------------------
copy nul c:\新建1.txt
echo. >c:\新建1.txt
1.列出的比较完美,2.3.偶尔会有产生空行或者乱码
会在新建文件内产生文字和乱码频繁的就不在此列出,
请自由选择。
There are many kinds.
1.------------------------------------
cd.>c:\New 1.txt
rem.>c:\New 1.txt
type nul>c:\New 1.txt
2.------------------------------------
c:>c:\New 1.txt
3.------------------------------------
copy nul c:\New 1.txt
echo. >c:\New 1.txt
The ones listed in 1 are relatively perfect. The ones in 2 and 3 occasionally produce blank lines or garbled codes. The ones that frequently produce text and garbled codes in the newly created files are not listed here. Please choose freely.
|
|
2010-7-11 21:59 |
|