DOS common command

xiaoxiao2021-03-06  26

Today, when compiling Java, I found that the command under DOS improves work efficiency, there are many very useful, such as Edit, Ren, Type, etc.

Let's take a common post to yourself:

CD change the current directory

[Usage]: Enter the subdirectory to enter the CD space subdirectory name (such as: CD Windows), want to return to the previous directory, enter CD .. (two points).

SYS making DOS system disks

[Usage] The format of the SYS command is simple: SYS drive name, for example in the C disk prompt: SYS A:, it is transmitted to the system file on the C drive to a disk, and the disk system in the A driver is started. plate. If the A disk is started, SYS C: is transmitted to the system file on the A disk to the C drive.

In addition to the sys command, you can also use the Format A: / S command to make a system disk while formatting the disk. If a floppy disk has a startup function, then there must be IO.SYS, MSDOS.SYS, and Command.com in its root directory, and the first two files must be on the front of the disk.

When we use the Dir command to view the original boot disk, we can see there in the root directory, but you can't see IO.SYS, MSDOS.sys two files. In fact, these two files are system files, which can be seen directly, if we can see them with a Dir / as command, this command is to view system files. Also, we cannot simply create a boot disk with a copy command, because the system file copied with a copy command is not necessarily placed on the front track.

Copy copy file

[Command Format] COPY Source File Name Document Name

[Precaution] No matter the source file or destination file: 1. If the drive name is not specified, it is the current drive; 2. If the directory is not specified, it is the current directory; 3. If the file name is not specified, it is the same file name.

[For example] 1, if there is a file in the root directory called XYZ.BAT, if we want to copy it called XYZ.OLD, you can enter the copy xyz.bat xyz.old to type DIR, except for the original XYZ.BAT In addition, a xyz.old file has appeared, and the size of these two files is the same.

2. If we want to copy the XYZ.com under the ABC directory to the current directory, type Copy C: /abc/xyz.com from the keyboard (note, omitted the destination name and file name), the source file name is C The xyz.com file in the ABC directory in the directory. Here, the driver and directory are pointed here, and the destination file is omitted, which means copying the file to the current directory, the name is constant, and is xyz.com.

3, if you want to copy the file to another drive, for example, copy to a disk, you can enter Copy Xyz.com A: (to remember to insert the disk into the A drive).

4, the copy command can also use wildcards, for example, copy all files that start on the A disk, you can enter COPY A: Y *. *, If you want to copy all extensions under the root directory of all extensions to the ABC directory In the case, you can enter Copy C: / *. BAT C: / ABC.

Del delete files

Deltree Delete Directory Tree

DIR column file name

[Usage]: DIR / P computer After the content is displayed, stop.

DIR / W If you just want to know what files and subdirectories in the directory, do not care about the generation time and size of the file, then use DIR / W to display a good choice in a short format. DIR ABC is to view information about file ABC in the current directory, including its size and generation time.

Diskcopy disable

Edit Text Editing

Format formatted disks

MD build subdirectory

[Usage] If you have to put your own files in a directory, you can enter MD XBS to build your directory. At this point, you will find a directory XBS with a Dir command.

RD Delete Directory

[Usage] For example, I want to delete the XBS directory and enter RD XBs. Do not believe in using the DIR command, the XBS directory is not. To delete a subdirectory in the current directory, enter the RD space plus subdirectory name to complete the task.

[Note: 1, you can't have a subdirectory in the directory you want to delete; 2. You can't have any files in the directory you want to delete; 3, you can't delete the current directory; 4, the root directory cannot be deleted.

MEM View memory status

TYPE display file content

Ren change file name

The following four commands are new, give the command format, try it yourself, learning computer is important to explore.

CLS clearing screen

[Applicable occasions] The screen is too messy, or there is garbled on the screen, clear any information on the screen but does not affect the internal internal information

[Usage] CLS Enter

Move mobile file, change the name

[Applicable occasions] mobile files to other directories

[Method] Move [file name] [directory] mobile files to new directory

Move [Directory Name] [Directory Name] Reform Directory Name

[Example] C: /> Move C: /autoexec.bat C: / OLD 

Move the autoexec.bat file to the OLD directory

C: /> Move C: /config.sys C: / Temp

Move the config.sys file to the OLD directory

More split screen display

[Applicable occasions] When the output is not used, it is useful when it is displayed, and it is useful for all commands, especially when Type is used. When using more, the disk does not have write protection, nor is it suitable for the CD-ROM.

[Method] TYPE [File Name] | More Split Screen Display File Content

More <[file name] Split screen display file content

[Example] C: /> Type Msdos.w40 | More

Xcopy copy directory and file

[Applicable occasions] is useful when making a copy together with subdirectory, and if you copy a lot of files than a copy command is much faster

[Method] XCopy [File Name] [Directory] Copy the specified file to the specified directory

Xcopy [Source Directory] [Directory] Put the source directory Lianzi directory into the destination directory

Xcopy *. * [directory] / s copy file with non-empty directory to the specified directory

Other common parameters also: V copy check, affect speed E and S, but the subdirectory will be copied.

转载请注明原文地址:https://www.9cbs.com/read-65579.html

New Post(0)