DOS overview and getting started (1)

  
        Most operating systems for home computers today use Windows, but before the introduction of Windows 95 in 1995, the dominant operating system was DOS (Disk Operation System). People who have been in contact with computers earlier must have heard of the name of DOS. Many people still remember the DOS era today. Although their computers have already used Windows, they still have to keep a DOS on the hard disk. Prepare for the occasion. So where is the charm of DOS? In the DOS environment, after booting, we are not facing the desktop and icons, but a computer screen like this: This C:\\> is called the prompt, and this flashing horizontal line is called the cursor. This means that the computer is ready, waiting for us to give it a command. What we need to do now is to issue commands to the computer, what commands to the computer, and what the computer will do. Then how do we issue commands to the computer? Very simple. For example, if we want to see what time it is, you can enter the time command and type the four letters of time. It means "time" in English, and then press the Enter key to confirm, then the screen will display Current time. Then press the Enter key and the prompt appears again, you can enter the next command. If you want to see the date, type date and press Enter to confirm. The current date is displayed on the screen. Then press the Enter key to return to the prompt. This is the DOS command input method. Unlike the Windows 95, which uses the mouse to find the icon to run the program, DOS uses the English command and the Enter key to execute the program. How about, completely different from Windows? In the character interface, we can only input characters through the keyboard to direct the computer to work. After the computer completes a command, the next prompt appears, and we can give the computer another command. Note that in DOS, the computer can only do one thing at a time. After doing this, we can start the next thing. Under Windows, we may let the computer do a few things at the same time. For example, we can copy the file while writing the article. While browsing the Internet. So people refer to DOS as a single-tasking operating system and Windows 95 as a multi-tasking operating system. In DOS, files and directories are the most important concept. This is the same as Windows. The difference is that "directory" is called "folder" in Windows. If we want to view the files on your computer, you can type the dir command and press Enter. You can look at it, the is the directory, and the other is the file. These directories store different kinds of files for different purposes. In DOS, the rule of the file name is 8.3. That is, a file name consists of the file base name and file extension. The middle is separated by a dot ".". The file base name consists of no more than 8 English letters or numbers. The name consists of no more than three English letters or numbers, the file base name must be there, and the extension can be absent. Note: When displaying the file list with the dir command, there is no "." separator between the file base name and the extension, but you must enter it when entering the full file name. The third column shows the size of the file, indicating how much storage space it occupies, that is, how much information the file contains. The more information it contains, the larger the file. The fourth column indicates the date the file was created or the last. The date of the change, each file has a corresponding generation time, just as everyone has their own birthday, the file generation time is when the file is formed. The time is expressed by the usual representation method, which is composed of year, month and day. The last column indicates the specific time at which the file was generated. The last letter a indicates morning and p indicates afternoon. Let's take a look at the last one or 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 also a file, but Its size is zero. The last line tells you that there is currently free disk space available for "xxx bytes" on your working disk. If we want to look at the files in the DOS directory, then we can type dir dos enter, that is, look at the meaning of the DOS directory, if you hit dir windows enter


is to view the meaning of the files in the windows directory. You can try to practice the dir command and observe what is under the folder. When you use the dir command to view files on disk, you will find that there are many file suffixes (that is, file extensions), and most of them have certain meanings. Files with suffixes of exe, com or bat can be executed directly. These files with exe suffix are called executable files; files with com suffix are called command files; files with suffix suffix are called batch files. If we want to execute these files, just type the file base name at the prompt and press Enter, no need to enter the file suffix. For example, the first line of this file is called format.com, and its suffix is ​​com. If we want to execute it, just type the file base name at the prompt and press Enter. You do not need to enter the suffix name. (This is actually the formatting command format that we have to learn later. Don't try to input the prompt text on the screen, otherwise the data on your A disk will be gone. After learning the follow-up chapters, you understand the command. Try again, don't use it now!) For example, the second line of this file mem.exe, whose suffix is ​​exe, is also a file that can be executed. Its function is to check the current memory usage of the computer. At the prompt, type mem and press Enter. (This command is fine, you can give it a try.) This shows how much memory the computer has, how much is used now, how much is left, how much basic memory is used, how much basic memory is left, etc. These will be Detailed explanation. When we view the file in the root directory of the c drive, we will often see this autoexec.bat file with a suffix of bat, indicating that it is a batch file and can be executed directly. The so-called batch processing, that is, you can execute a lot of commands. When we want the computer to complete a series of tasks, we can execute them one by one, or you can load these commands into a file. Just type the file name, the computer. This batch of commands will be executed once. In practice, we often create batch files to complete many tedious tasks with fixed steps. Now that 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 use the dir command to see if there are files with their suffixes. In general, you can find one or several such files, you can safely execute them. Of them, one of them must be right. It doesn't matter if it is wrong. Generally, it will not have much impact. In DOS, there is a concept of the current directory, which is the directory displayed by the prompt. The current prompt is C:\\, then the current directory is the root directory of the C drive, and the \\ (backslash) indicates the root directory. If you want to change the current directory, you can use the cd command, for example, we enter cd dos, it means to replace the current directory as dos directory, after the carriage return, you see, the prompt becomes C:\\DOS, which means the current directory changes Has become the DOS directory of the C drive, what is the meaning of the current directory? Here, we type dir to try, see, the files listed now are not just seen, these are the files in the DOS directory, which shows that the dir command lists the contents of the current directory. Also, when we enter the executable file name, DOS will look for the file in the current directory. If there is no such file, DOS will prompt an error message. So what is the structure of the catalog? The directory is a tree structure. As you can see, the following is a schematic diagram of a directory structure. This C: indicates the top level directory, called the root directory. The other directories are subdirectories of the root directory, such as DOS, WINDOWS, TOOLS. Etc, and DOS, WINDOWS directory itself has subdirectories, such as the TEMP directory under DOS, the SYSTEM directory under WINDOWS. We use the CD command to change the current directory, enter CD DOS, then the current directory becomes DOS, sometimes we change the current directory to a subdirectory called into the subdirectory, then we are now entering the DOS directory, then enter the CD TEMP, then we will enter the TEMP directory again, how to exit T


EMP directory? Just type CD .., press Enter, we can go back to the DOS directory. In DOS, these two points represent the directory above the current directory, a dot indicates the current directory, and sometimes we call the parent directory as the parent directory. Then type CD .., then press Enter, we will return to the root directory of the C drive. Entering a subdirectory of a directory does not require a CD command to enter layer by layer. It can be done with one line of commands. For example, to enter the SYSTEM subdirectory under the WINDOWS directory, just enter CD WINDOWS\\SYSTEM, or enter CD C. :\\WINDOWS\\SYSTEM, if you want to go back to the root directory, then you don't have to enter the CD multiple times.. To complete, you can directly enter the CD \\,\\ to indicate the root directory. When using the dir command to list a list of files in a subdirectory, we will find that both . and .. count as the number of files, but the size is zero. What if we want to replace the current directory with another partition on the hard disk? Of course, I don't use a CD, otherwise I don't have to say it. I should enter the drive letter and press Enter. For example, to go to the D drive, then type D:, then press Enter, hey, now the prompt becomes D:\\>. Then use the dir command to list the files on the D drive. In fact, to fully express a subdirectory should be a drive letter plus directory, such as C: \\DOS\\TEMP, then fully express the file? It is the drive letter plus directory plus file name, such as C:\\DOS\\TEMP\\ME.TXT, C:\\DOS\\TEMP\\ is called the path of ME.TXT. As we said earlier, when you enter the executable file name, DOS will look for the file in the current directory. If it is not found, it will prompt the wrong file name, but we do not have to change the current directory to the directory where the file is located to run. Its, you can add the full path in front of the file name. For example, our current directory is C:\\DOS, we want to run D:\\TEST\\PCT.EXE, then we can directly input D:\\TEST\\ PCT.EXE returns, so that we can execute files in other directories without changing the current directory. When the computer is just started, it is necessary to read some system programs from a disk into memory before it can work normally. We call this disk a boot disk. Usually, we use the A disk or the C disk as the boot disk. In special cases, other drive letters of the hard disk and a few computer CDs can also be used as the boot disk. To make a boot disk, you need to use the sys command. See the command section below. When the DOS system starts, you must first read the two system files IO.SYS, MSDOS.SYS from the boot disk, and then find and execute the three files CONFIG.SYS, COMMAND.COM, AUTOEXEC.BAT in the root directory of the boot disk. . The three files IO.SYS, MSDOS.SYS and COMMAND.COM are indispensable, otherwise the computer will not be able to start CONFIG.SYS and AUTOEXEC.BAT normally. These two files are used to configure the system running environment and automatically execute some commands. They play a vital role in the performance of the computer and the drive of many devices. We can modify their contents according to their needs. autoexec.bat is called automatic batch file, which is a kind of batch file. Because DOS automatically runs when it starts, it is called an automatic batch file. You can put the program you want to run each time you start your computer. If the computer can't find these two files in the root directory, it can also run, but there are many complicated software and devices that will not work. Such as CD-ROM, sound card and Windows programs. Therefore, beginners should be careful not to delete the above files, otherwise, the computer will not work properly.

Copyright © Windows knowledge All Rights Reserved