Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the commonly used DOS commands

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "what are the commonly used DOS commands". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the commonly used DOS commands"?

Let's first introduce the concept of wildcards.

Wildcard characters * and?

* represents a string

? Represents only one character

Note that wildcards can only be used with file names or extensions, not all of them. For example, if we want to find all files that begin with the letter y, we can enter the following command: dir yawn. files; if we want to find all files with the extension exe, we can use dir .exe.? It represents only one character. For example, if I want to find all the files with the second letter s, I can type: DIR? swords. *.

1. Dir

Dir is the abbreviation of the English word directory (directory). It is mainly used to display files and subdirectories under a directory.

[function] displays the information of files and subdirectories in the specified disk and directory, including the volume label of the disk where the files and subdirectories are located, the names of files and subdirectories, the size of each file, the date and time when the files and directories were established, as well as the number of file subdirectories, the total number of bytes occupied and the total space left on the disk.

[format] dir [C:] [path] [filename] [.ext] [/ o] [/ s] [/ p] [/ w] [/ a]

[description] dir is the most commonly used DOS command. The slash indicates that what follows is a parameter. The following four parameters are most commonly used for DOS:

Parameter number

Meaning and meaning

/ p

When the display information is full of one screen, pause the display and press any key to display the next screen

Www.yisu.com

/ o

Sort the display. O can be followed by letters with different meanings

/ w

Only the file name directory name is displayed, with five file names per line. That is, wide row display

/ s

Display all directory files of directories and subdirectories

/ a

Show hidden files

[example] display the information in the C:\ WINDOWS\ Desktop folder

2. Md

Md is the abbreviation of make directory (create directory).

[function] create a subdirectory

[format] md [C:] path

[example] create a directory called purple with md

3. Cd

Cd is the abbreviation of change directory (changing directory).

[function] change or display the current directory

[format] cd [C:] [path]

[description] absolute path and relative path can be used. If there is only cd and no parameters, only the current path is displayed. Note: there must be two "special directories" in the subdirectory, namely ".". One point represents the current directory and two dots represent the upper directory. From a simple and practical point of view, we can solve all problems as long as we learn to enter layer by layer (a directory name below the cd) and exit layer by layer (cd..). Of course, the absolute path can also be used.

Www.yisu.com

[example] enter the purple directory we just established

4. Rd

Remove directory-- delete directory

[function] delete empty subdirectory

[format] rd [d:] path

[description] rd is a command specifically for deleting empty subdirectories. Pay attention to two items: first, you cannot delete a non-empty directory; second, you cannot delete the current directory.

[example] delete purple directory with rd

Let's use the three commands md, cd and rd.

5. Copy

Copy means to copy in English.

[function] copy a file or group of files to a specified disk or directory

[format] copy [C:] [path] [filename.ext] [C:] [path] filename.ext

[description] the basic usage of the copy file command is: "copy source file name target file name". If you write only the destination path but not the destination file name, it means replication with the same name; otherwise, it is called renamed replication. Note that renaming replication generally does not change the file extension.

[example] to copy all the files in the C:\ purple directory to the floppy disk, you can issue the following command. Please note that the current disk is different from the current path:

C:\ > copy purple A:\

If there is already a file with the same name on the target disk, the following prompt appears, "Overwrite xxxx (Yes/No/All)" answers Y to overwrite the current file, N to keep, and A to overwrite all subsequent files without further questions.

6. Del

Del is an acronym for delete.

[function] Delete a file or group of files in a specified disk or directory

[format] del [C:] [path] filename.ext

[description] this command should be used with care. Once deleted, it will not be easy to recover. You can also use wildcards to delete a class of files. When using *. *, a warning will be given for safety, and the confirming party will delete it. If there is no message prompt in the deletion process, it means that it has been deleted correctly.

Note that this command cannot delete files with read-only, implied, system attributes; if the specified file does not exist, the prompt "File not found" appears; DOS can restore files deleted by mistake with UNDELETE external command; it can only delete files, not directories.

7. Ren

Ren is an abbreviation for rename (renamed)

[function] change the name of a file or group of files in a specified disk or directory

[format] ren [C:] [path] filename1 [.ext] filename2 [.ext]

[description] the renaming operation is limited to the name of a group of files, and it does not change the directory where the files are located.

If wildcards are used, a batch of files are renamed.

8. Type

[function] command to display text file contents on the screen

[format] type [C:] [path] filename.ext

[description] the type command is used to quickly and easily display the contents of a text file on the screen, and a file with the extension TXT is a text file.

If you use this command to display other files with the extension EXE or COM

The result of the output is often some messy symbols accompanied by irregular ringtones, and sometimes even a crash.

9. Format

[function] disk formatting

[format] [C:] [path] format drive: [/ S]

[description] all kinds of disks made by manufacturers can be used to store files under various operating systems. The disk formats of different operating systems are generally different and are not universal. The format command is to make a new disk recognizable by the DOS operating system to store DOS files.

The process of formatting the disk by this command is actually the process of planning the disk using the information storage format specified by DOS. When formatting the disk, it is necessary to erase all the data that already exists on the disk, write a boot record on the disk, divide the file allocation table and the root directory, and find out all the bad sectors on the disk and mark them as unusable. We only have one command parameter listed here: / S. When this parameter is used, the disk is formatted and loaded into the operating system file to become a boot disk. It is equivalent to format and then make the next command: SYS.

10. Discopy

Diskcopy, translated into Chinese, means disk copy.

[function] copy a disk that is exactly the same as the original disk

[format] diskcopy source drive name destination drive name

[description] its main purpose is to back up. For example, when our computer is just bought, it will come with some device driver disks, these drivers may be used in the future, in order to prevent the damage of these disks, be sure to backup them all, at this time, using the diskcopy command is relatively fast and convenient.

11. Deltree

[function] delete directory tree

[format] [C:] [path] DELTREE [C1:] [path2] [[C2:] [path3] […]]

[description] this command destroys the entire specified directory tree, regardless of whether it is read-only, hidden or not. Special care should be taken when using. It's a dangerous order.

12. Mem

Mem is the abbreviation of memory.

Www.yisu.com

[function] this command is used to check how much memory is in your computer and how much memory is being used.

[format] directly type the mem command

13. Chkdsk

Chkdsk is the abbreviation of check disk.

[function] used to check the usage of your disk.

[format] chkdsk disk name

[description] for example, to check the use of disk A, enter chkdsk A:, check the use of disk c, enter chkdsk C:, and if you enter chkdsk directly, check the use of the current disk.

14. Sys

[function] transfer system file commands. Transfer the two implied systems IO.SYS and MSDOS.SYS of DOS to a specific location on the target disk and copy the COMMAND.COM file over. After completion, the target disk becomes the boot disk of DOS.

[format] [C:] [path] SYS [C1:] [path] D2:

[note] because these files need to be copied to a specific location, the replication completed with the COPY command may not be able to start the machine. Through the SYS command, DOS can move files that have already occupied a specific location on the target disk and copy system files to the appropriate location. The parameter C1ath is used to indicate the directory where the system files are located. If not specified, the default is the current directory of the current disk. So this command is usually carried out in the root directory of the source disk.

15. Path-KO's words: thank tanglu_sd for pointing out. The original text is pass. It is the original text that is wrong!

[function] set the directory where DOS looks for .com, .exe, .bat files

[format] path= [[drive:] path [; …] Or path

16. Edit

[function] the edit command is a simple editing software that we often use to edit some programs and batch files.

17. Cls

[function] clear the contents on the monitor screen and make the DOS prompt to the upper left corner of the screen.

[format] cls

18. Time

[function] display and set the system time of DOS

[format] time [hh [: mm [: ss [.cc]

19. Date

[function] display and set the system date of DOS

[format] date [MM-DD-YY]

20. Ver

[function] displays the version number of the running DOS system

[format] ver

Commands: functions:

Attrib. Set file properties

Ctty. Change the control equipment

Defrag. Disk defragmentation

Doskey. Invoke and create DOS macro commands

Debug. Program debugging command

Emm386. Extended memory management

Fc. File comparison

Fdisk. Hard disk partition

Lh/loadhigh... Load the program into high-end memory

Move. Move files, change directory name

More. Split screen display www.yisu.com

Prompt. Set up the prompt

Set. Set environment variabl

Smartdrv... Set up disk Accelerator

Setver. Set version

Subst. Path replacement

Vol. Displays the specified disk volume label

Xcopy. Copy directories and files

Thank you for your reading, these are the contents of "what are the commonly used DOS commands?" after the study of this article, I believe you have a deeper understanding of what the commonly used DOS commands have, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report