Basic dossystem knowledge

Source: Internet
Author: User

First, what is dos?

DOS is short for diskoperationsystem (Disk Operating System. As its name implies, this is an operating system based on disk management. The biggest difference with the operating system we are currently using is that it is in the form of a command line. It relies on input commands for man-machine interaction and sends commands to computers through commands, allows the computer to perform operations. Therefore, the operation method is very simple. You only need to enter the command and press enter, and the system will execute the command.

In essence, Windows 95 and Win9x versions are included. These graphic operating systems are completely built on DOS. I just wore a dress.

In addition, we can find the DOS shadow in any version of the widows series. In the Win9x/me Start Menu, type the "command" command in the running program to enter the command line interface. In the Win2000/NT Start Menu, type the "cmd" command in the running program to enter the command line interface. In addition, Windows 2000 and XP can both be used to enter the console by using the boot disc. The console is also in the form of command lines. The system maintenance commands in the console are also largely the same as those in the doscommand. If DOS is used, it will basically be controlled. In many cases, the problem that cannot be properly solved by using the graphical interface can be solved through the command line.

It should be emphasized that the command line program can be divided into internal commands and external commands. The internal commands are loaded into the memory with command.com, and the external commands are a separate executable file.

Internal commands are concentrated in the command.com file in the root directory. The computer reads the file into the memory every time it starts. That is to say, these internal commands reside in the memory during computer running, you cannot see these internal commands using the Dir command.

External commands are stored on disks as independent files. They are all files suffixed with "com" and "EXE". They are not resident memory and are only required by computers, will be transferred to the memory.

Next, let's take a look at some of the DOS documentation specifications.

In the dossystem, the following format is generally used to describe the doscommand: "dir [C:] [path] [filename] [. EXT] [/o] [/S] [/P] [/W] [/A]"

"Dir" is the doscommand, followed by the command parameters. in DOS, you can use the command + /? Command Parameters and related functional explanations. When you encounter a strange doscommand in the future, you can use this method to learn the command parameters and learn how to use them.

C:

This part is a drive letter. If it is a drive D, it is D:, and so on. Disks are not used in many operating systems.

Path

Indicates the path. If no path exists, operations are performed on the current directory of the current disk.

Filename

File Name, which indicates the main name of the file. A certain Program often processes files with a certain extension. Therefore, you do not need to enter the extension.

. Ext

Extension, relative to the file extension of the preceding Primary name. It is generally used to describe the file format.

Filespec

File Identifier

[]

Square brackets indicate that the items are optional. You can leave them Blank Based on your needs.

{}

Braces, indicating that a project must be selected

|

A vertical line, indicating that either of the two sides can be used

...

Repeated items.

In this section, we mainly want to talk about the commonly used doscommands.

There are about one hundred doscommands in total (including text editing, virus detection, configuration files, batch processing, and so on). It seems that it is not very realistic to introduce them one by one, that is, there are only a few 10 or 20 commonly used commands, we will introduce the 10 or 20 commonly used doscommands.

I. Directory operation commands:

1. dir

DIR is the abbreviation of directory, which is used to display files and subdirectories in a directory.

[Function] displays files and subdirectories in a specified disk or directory, includes the volume label of the disk where the files and subdirectories are located, the name of the files and subdirectories, the size of each file, and the date and time when the files and directories were created, and the number of file subdirectories, the total number of bytes occupied, and the total space remaining on the disk.
[Format] dir [C:] [path] [filename] [. Ext] [/o] [/S] [/P] [/W] [/A]
[Note] DIR is one of the most commonly used doscommands. A slash indicates that the following content is a parameter.

Parameter meaning

/P: When the display information is full, the display is paused. Press any key to display the next screen.

/W only displays the directory name of the file name. Each row contains five file names.

/S displays all the directory files and subdirectories. If dir [filename]/s is used, it is used to search for eligible files in the current column and Its subcolumns.

[Example] show the files in the C:/mybook/directory: Dir C:/mybook /*.*

2. md

MD is the abbreviation of make directory.

[Function] create a sub-directory
[Format] MD [C:] path
[Example] Use MD to create a directory named Mage: md c:/MAGE

3. CD

CD is the abbreviation of Change directory.

[Function] changing or displaying the current directory
[Format] CD [C:] [path]
[Description] Two Types of paths are available: absolute path and relative path. If there is only CD but no parameter, only the current path is displayed. Note: There must be two "Special directories" in the subdirectory, namely "." and "...". One of them indicates the current directory, and the other two indicate the previous directory. From a simple and practical perspective, we can solve all the problems by learning to enter (a directory name under the CD layer) and exit (CD ..) layer by layer. Of course, you can also use the absolute path method.
[Example] use CD to transfer the created mage directory cd c:/MAGE

4. Rd

Remove directory -- delete a directory

[Function] deletes an empty sub-directory.
[Format] RD [D:] path
[Note] RD is a command used to delete empty sub-directories. Note: You cannot delete a non-empty directory or the current directory.
[Example] Use rd to delete the mage directory.

Ii. File Operation commands:

5. Copy means copying in English.

[Function] copies one or more 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 the source file name target file name ". If you only write the target path without writing the target file name, it indicates copying with the same name; otherwise, it is called renaming. Note: Do not change the file extension during name-change replication.
[Example] to copy all files in the C:/MAGE directory to a floppy disk, run the following command. Note that the current disk is different from the current path:

C:/> copy C:/MAGE/*. *:

If a file with the same name already exists on the target disk, the following message is displayed: "overwrite xxxx (Yes/No/All)". Then, if you answer y, the current file is overwritten, and N is retained, A will overwrite all subsequent documents without asking questions.

6. DEL

Del is the abbreviation of Delete.

[Function] deletes one or more files from a specified disk or directory.
[Format] del [C:] [path] filename. ext
[Note] This command should be used with caution. Once deleted, it will not be easy to restore. You can also use wildcards to delete a type of files. When *. * is used, a warning will be given for security purposes, and the confirmation party will delete the work. If no message is displayed during the deletion process, the deletion is correct.

Note that this command cannot delete files with read-only, implicit, and system attributes. If the specified file does not exist, the message "file not found" appears; DOS can use the undelete external command to restore objects that are accidentally deleted. It can only delete files and cannot delete directories.

 
7. Ren

Rename is short for rename.

[Function] changes the name of a file or a group of files in a specified disk or directory.
[Format] Ren [C:] [path] filename1 [. Ext] filename2 [. Ext]
[Note] the renaming operation is only limited to the names of a group of files in a file. It does not change the directory where the files are located. If a wildcard is used, rename a batch of files.

8. Type

[Function] command for displaying text files on the screen
[Format] type [C:] [path] filename. ext
[Note] the type command is used to quickly and easily display the content of a text file on the screen. A file with the extension of txt is a text file. If you use this command to display files with an extension of EXE or com, the output result is often a mess of symbols with irregular bells, and sometimes even crashes. If the screen cannot be displayed, you can add | more at the end of the command.

Iii. Disk operation commands

9. Format

[Function] disk formatting
[Format] [C:] [path] format drive: [/S]
[Note] various disks manufactured by the manufacturer can be used to store files in various operating systems. The disk formats of different operating systems are generally different and are not universal. The format command enables a new disk to be recognized by the DOS operating system to store DoS Files.

This command is actually used to plan the disk in the information storage format specified by DOS. When formatting a disk, clear all existing data on the disk, write boot records on the disk, and divide the File Allocation Table and root directory. At the same time, it also finds all bad sectors on the disk and marks them as unavailable. Here, we only list one command parameter:/s. When this parameter is used, the disk is formatted and loaded into the operating system file to convert it into a boot disk. It is equivalent to format and then run the following command: SYS.

10. discopy

Diskcopy.

[Function] copies a disk with the same content as the original disk.
[Format] diskcopy source drive name destination drive name
[Description] The feature is that the track is completely replicated to the track. It is mainly used for backup. For example, when our computer is just purchased, it will randomly attach some device driver disks, which may be used in the future. To prevent the disk from being damaged, make sure to back up all of them. In this case, the diskcopy command is quick and convenient.

11. deltree

[Function] deletes a directory tree.
[Format] [C:] [path] deltree [C1:] [path1] [C2:] [path2] […]
[Note] This command eliminates the entire specified directory tree, regardless of whether it is read-only or hidden. Be especially careful when using it. It is a dangerous command.

12. chkdsk

Chkdsk is short for check disk.

[Function] is used to check the usage of your disk.
[Format] chkdsk disk name
[Description] For example, to check the usage of disk A, enter chkdsk A: To check the usage of disk C, enter chkdsk C:. If you enter chkdsk directly, check the usage of the current disk.

13. sys

[Function] Transfers System File commands. Transmit the two implicit dos systems Io. sys and msdos. sys to a specific location on the target disk and copy the command. com file. After completion, the target disk becomes the DOS boot disk.
[Format] [C:] [path] sys [C1:] [path] D2:
[Note] because these files need to be copied to a specific location, the copy command may not be able to start the machine. Through the Sys command, DOS can move the files in a specific location on the target disk and copy the system files to the corresponding location. The C1: path parameter specifies the directory where the system file is located. If this parameter is not specified, the current directory of the current disk is used by default. Therefore, this command is generally performed in the root directory of the source disk.

Originally, the DOS should end after the command is completed. However, most of the online users have no access to DOS, and there is little chance of DOS access in the actual application environment, so let's talk about system device loading and system environment settings in DOS so that you can really use dos.

The first thing to do is to configure the environment in DOS. Basically, you must use the config. sys and autoexec. BAT files. Config. the sys file is a professional system startup configuration file. It is mainly used to load the memory management program, set the extended memory and extended memory, load hardware drivers, and set environment variables, create necessary user environments for normal use of user computers (in the DOS era, proficient in config. sys files are often the marker of "experts ). (In Windows 95/98, the system has built-in settings such as memory management and environment variables, config. the role of the Sys File is far from that important, and it is still "in service" mainly to maintain compatibility with earlier dos applications)

Some configuration items frequently used in config. sys are as follows:

1. Files = numbers

Indicates the number of files that can be opened at the same time. Generally, you can select 20 to 50. Note that if you set the value of files to a large amount of basic memory. The default value is files = 8.

2. buffers = numbers

Indicates the number of disk buffers, usually about 20-30. The default value is 15. A disk buffer is a memory area used to store data read from or written to a disk.

3. device and devicehigh

Load some memory resident programs for device management. For example, the memory management program and the drive program. For example:

Device = c: \ dos \ himem. sys

Device = c: \ dos \ emm386.exe Ram

Devicehigh = c: \ CDROM. sys

The difference between devicehigh and device is that the former adds programs to the high-end memory.

4. himem. sys and emm386.exe

DOS can only use KB of memory directly, that is, basic memory. It must rely on other memory management programs to use more memory. These two commands are the most commonly used memory management program.

Among them, the memory between kb and 1 MB is called high-end memory, which is reserved by the system. Memory larger than 1 MB becomes extended memory, and himem. sys is responsible for managing extended memory.

Emm386.exe manages high-end memory and simulates memory expansion in the extended memory for some software.

Therefore, to use more memory, the configuration file should contain the following commands.

Device = c: \ dos \ himem. sys

Device = c: \ dos \ emm386.exe Ram

Note: emm386.exe must first install himem. SYS. Therefore, you must ensure that the configuration command for installing himem. sys is before emm386.exe.

5. Dos = high, umb

In general, you need to add the config. SYS file to this command, which will move the DOS system file into the high-end memory and leave more basic memory for other software. Note that if emm386.exe and umb are not installed, this command will be invalid.

The following is a typical config. SYS file:

Device = c: \ dos \ himem. sys (load himem and extend the Memory Manager)

Device = c: \ dos \ emm386.exe noems (high-end memory incorporated into extended memory)

Buffers = 15, 0 (number of buffers)

Files = 50 (number of files simultaneously opened)

DOS = umb (where does the system place dos itself)

Lastdrive = z (the maximum drive letter can be used)

DOS = high

Devicehigh = c: \ dos \ atapi_cd.sys/D: mscd000/I: 0 (load the optical drive driver .)

Stacks = 9,256

In addition, you can configure menu-based multi-task selection in config to select different tasks, such as playing games and setting Virtual Disks. However, these applications are currently not commonly used, I will not introduce it more here.

With config. sys, most environments can be configured, but in some cases, you still need autoexec. BAT to collaborate to load system devices, such as optical drives. In addition, if a write device directly uses commands to drive the driver, it is best to execute the driver directly in autoexec. bat, such as the mouse.

Below is a typical autoexec. BAT:

About autoexec. bat

The computer automatically searches for autoexec every time it starts. bat batch files, so that you can execute some commands to be executed every time you start up, such as setting the Path, loading the mouse driver mouse, disk acceleration smartdrv, etc.

The following is a typical autoexec. BAT file:

@ Echo off 'command line not displayed

'Set a directory prompt before the prompt

Prompt & P & G

Path c: \ DOS; C: \ WINDOWS; C: \ tools 'sets the file search path

LH c: \ mouse. com

'Load the mouse driver

LH c: \ dos \ smartdrv. exe

'Attach disk acceleration Management

LH c: \ dos \ mscdex/S/D: mscd000/M: 12/V 'load CD-ROM driver

'Set temporary directory

Set temp = c: \ Temp

If you need to start the Chinese system, you can also add the startup command of the Chinese system. After the Chinese system is started, the Chinese DOS is generated.

Use the config. sys and autoexec. BAT files to complete the configuration of the DOS system environment in most cases.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.