DOS overview and getting started

Source: Internet
Author: User

Currently, most of the operating systems of home computers use Windows. However, before the launch of Windows 95 in 1995, the dominant operating System was the Disk Operation System (DOS ).

People who have been familiar with computers may have heard of DOS, and many others still miss the DOS era today. Although their computers have already used Windows, however, we still need to keep a copy of DOS on the hard disk for emergency purposes.

So what is the charm of DOS?

In the DOS environment, after the boot, we are not facing the desktop and icon, but such a computer screen: This C: \> is called a prompt, and this flashing crossline is called a cursor. This means that the computer is ready, waiting for us to give it a command. What we need to do now is to give commands to the computer and what the computer will do. How can we issue commands to computers?

Very simple. For example, if we want to see the time, we can enter the time order and input four letters of time, which means "time" in English, and then press the Enter key to confirm, the current time is displayed on the screen.

Press the Enter key and prompt again. You can enter the next command.

If you want to view the date, enter the date, and then press enter to confirm. The current date is displayed on the screen. Press the Enter key to return to the prompt.

This is the DOS command input method. Unlike Windows 95 that uses the mouse to find the icon to run the program, DOS uses the input of an English command and the carriage return key to execute the program.

How about it? It's totally different from Windows? On the Character interface, we can only input characters on the keyboard to direct the computer's work. After the computer completes a command, the next prompt appears, and we can give the command to the computer again. Note that only one task can be performed on a computer in DOS, And the next task can be started after the task is completed. In Windows, we may allow the computer to do several tasks at the same time, for example, we can copy files and write articles while browsing the Internet. Therefore, DOS is called a single-task operating system, while Windows 95 is called a multi-task operating system.

In DOS, files and directories are the most important concepts. This is the same as in Windows. The difference is that "directories" are called "Folders" in Windows ".

If you want to view files on your computer, enter the dir command and press Enter. As you can see, the directory with <dir> is followed, and the files without it are all stored in different categories for different purposes.

In DOS, the file name rules are in the 8.3 format, that is, a file name is grouped by the basic file name and file extension. separated by ". The basic names of a file consist of no more than 8 English letters or numbers. The file extension consists of no more than three English letters or numbers. The basic names of a file must exist, and the file extension may not exist.

Note: When you use the dir command to display the file list, there is no "." separator between the basic name and extension of the file, but you must enter it when entering the complete file name. The third column displays the file size, indicating the storage space occupied by the file, that is, the amount of information contained in the file. The more information contained, the larger the file; the fourth column indicates the date on which the file was created or the Last modified Date. Each file has a corresponding generation time, just as everyone has their own birthday, the file generation time is the time when the file is formed. The time is usually represented by years, months, and days. The last column indicates the specific time when the file is generated. The last letter a indicates morning and p indicates afternoon.

Let's take a look at the last two lines. What do these mean. "10 file (s)" is to tell you that there are "10" files in this directory. These files add up to a total of "64,692 bytes". In this calculation, each subdirectory is a file, but its size is zero. The last line tells you that there is still "xxx bytes" available disk space on your work disk.

If we want to see the files in the DOS directory, we can press dir dos and press enter to view the meaning of the DOS directory, if you press dir windows, press enter to view the files in the windows directory. You can try to practice the dir command and observe the things in the folder.

When you use the dir command to view files on a disk, you will find that there are many file extensions, most of which have some meanings.

All files suffixed with exe, com, or bat can be directly executed. These files suffixed with exe are called executable files; Files suffixed with com are called command files; Files suffixed with bat are called batch files. If you want to execute these files, you only need to enter the basic name of the file at the prompt and press Enter. You do not need to enter the file suffix.

For example, the file name in the first line is format.com, and its suffix is com. If we want to execute it, we only need to enter the basic name of the file at the prompt and press enter without entering the suffix name. (This is actually the formatting command format we want to learn later. Do not try to input text as prompted on the screen. Otherwise, the information on disk A will be gone. after learning the subsequent chapters, try again after you understand this command. Do not use it unless necessary !)

For example, in the second line, the file mem.exe is suffixed with exe, which is also an executable file. Its function is to view the current memory usage of the computer. Press mem at the prompt and press Enter. (This command is okay. You can try it)

This shows how much memory the computer has, how much memory is used, how much memory is left, how much basic memory is used, and how much basic memory is left, these are explained in detail below.

When we view the file in the root directory of drive C, we often see this autoexec. bat file with the suffix bat, indicating that it is a batch file and can be executed directly.

The so-called batch processing means that many commands can be executed. When we want the computer to complete a series of tasks, we can execute commands one by one or load these commands into one
In the file, just knock on the file name, the computer will execute this batch of commands once.

In practice, we often create batch processing files to complete a lot of tedious work with fixed steps. Now you know which files on your computer are directly valid for you.
They are files suffixed with com, exe, or bat.

So when you get a new software, you can first run the dir command to check whether there are any files suffixed with them. Generally, you can find one or several of these files, you can safely execute them. One of them must be right. If you make a mistake, it doesn't matter. Generally, it won't have a big impact.

In DOS, there is a concept of the current directory, that is, the directory displayed by the prompt. The current prompt is C: \, and the current directory is the root directory of drive C, this \ (backslash) indicates the root directory.

If you want to change the current directory, you can use the cd command. For example, if we enter cd dos, the current directory is changed to the dos directory. After you press enter, you can see that the prompt is changed to C: \ DOS, which indicates that the current directory has changed to the DOS directory of drive C. What is the significance of the current directory?

Here, Let's enter dir and try it. The files listed are not what we saw just now. These are all files in the DOS directory. This shows that the files listed by the dir command are, is the content in the current directory. In addition, when we enter an executable file name, DOS will search for the file in the current directory. If the file does not exist, DOS will prompt an error message.

What structure is the directory? The directory is a tree structure. You can see that the following is a directory structure. This C: indicates the top-level Directory, which is called the root directory.
All directories are subdirectories of the root directory, such as DOS, WINDOWS, TOOLS, etc. DOS and WINDOWS directories also have subdirectories, such as TEMP directory under DOS and SYSTEM directory under WINDOWS.

We use the CD command to change the current directory and input the cd dos command, then the current directory becomes DOS. Sometimes we change the current directory into a subdirectory called entering the subdirectory, that
Now we are entering the DOS directory and then entering cd temp. Then we will go to the TEMP directory again. How can we exit the TEMP directory? Just type CD... and press enter to return to the DOS directory. In DOS, these two points indicate the upper-level directory of the current directory, and one point indicates the current directory. Sometimes, we call the upper-level directory as the parent directory. Enter CD... and press Enter. Then we will return to the root directory of drive C.

To enter a subdirectory of a directory, you do not need to use the CD command to access the subdirectory layer by layer. You can use a line of command to do this. For example, to enter the SYSTEM subdirectory of the WINDOWS directory, you only need to enter cd windows \ SYSTEM, you can also enter cd c: \ WINDOWS \ SYSTEM. If you want to return to the root directory, you do not have to input CD multiple times .. you can directly input CD \, \ to indicate the root directory.

When you use the dir command in the subdirectory to list files, we will find that both. And. are counted as the number of files, but the size is zero.

What if we want to change the current directory to another partition on the hard disk? Of course, CD is not used. Otherwise, I don't need to mention it. In this case, enter the drive letter and press Enter. For example, if you want to access disk D, enter D: And press Enter. Now the prompt is changed to D: \>. Use the dir command to list the files on the d disk.

In fact, to completely display a subdirectory, it should be a drive letter plus a directory, such as C: \ DOS \ TEMP. What about the complete expression of the file? Is to add the drive letter to the Directory and the file name, such
C: \ DOS \ TEMP \ ME. TXT, C: \ DOS \ TEMP \ is called the path of ME. TXT.

As we said just now, when you enter an executable file name, DOS will find the file in the current directory. If it cannot be found, an error will be prompted for the file name, however, we do not have to replace the current directory with the directory where the file is located to run it. we can add the complete path before the file name. For example, our current directory is C: \ DOS: Run D: \ TEST \ PCT. EXE, then we can directly enter D: \ TEST \ PCT. EXE press enter, so that we can execute files in other directories without changing the current directory.

When the computer is started, some system programs must be read from a disk into the memory before it can work normally. We call this disk a boot disk.

Generally, disk A or disk C is used as the boot disk. In special cases, other drive letters of the hard disk and A few computer discs can also be used as the boot disk. To create a boot disk, run the sys command. See the command section below.

When the DOS system is started, you must first read two system file IO from the boot disk. SYS, MSDOS. SYS, search for and execute CONFIG in the root directory of the boot disk. SYS, COMMAND. COM, AUTOEXEC. BAT files. IO. SYS, MSDOS. SYS and COMMAND. COM. SYS and AUTOEXEC. BAT files are used to configure the system running environment and automatically execute some commands. They play a crucial role in the computer running performance and the drivers of many devices, we can modify their content as needed, autoexec. bat is called an automatic batch processing file. It is a type of batch processing file. Because it runs automatically at DOS Startup, it is called an automatic batch processing file. You can put the program you want to run every time you start the computer.

If the computer cannot find these two files in the root directory, it can also run, but there are a lot of complex software and equipment will not work properly. Such as optical drive, sound card, and Windows program. Therefore, Beginners should be careful not to delete the above several files; otherwise, the computer will not work properly.

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.