Complete dos tutorial-basic stuff

Source: Internet
Author: User
As dos, it should be said that it is the only way for new users to go without talking about network security or system operations.

Recently, a friend strongly urged me to write a DOS tutorial. If you want to write a DOS tutorial, you have nothing to do with it.

I found the excellent post, so I took it back ~ Ask the majority of class C students to study hard
Common dos knowledge

DOS Overview
Disk Operating System (DOS) is a widely used disk operating system. Even the popular Windows 9x/me system is based on it.

There are two common dos types: PC-dos in IBM and MS-dos in Microsoft. Their functions and command usage formats are the same. We usually use MS-dos.

Since the advent of DOS in 1981, the version has been constantly updated, from the initial dos1.0 to the latest dos8.0 (Windows ME system), the highest version of pure DOS is dos6.22, later versions of DOS are provided by Windows systems and do not exist independently. The following describes how to use the DOS Windows 98 4.10.2222a dos7.0 system.
Basic dos knowledge

(1) DoS Composition
DOS is divided into two parts: the Core Startup Program and the command program.

DOS core boot programs include boot system boot programs, Io. sys, msdos. sys, and command.com. They are the most basic components of the DOS system, and can be started with their systems.

However, simply starting a program does not work. As a ready-to-use operating system, DOS generally performs operations through commands. Doscommands include internal commands and external commands. Internal commands are common command programs that occupy little space, such as Dir and CD. They exist in the command.com file and are loaded into the memory at system startup for convenient calling. Some other external commands exist as separate executable files and are transferred to the memory only during use.
(TIPS: executable program files include *. COM and *. EXE. Generally ,*. the EXE file is the software executable program, and *. COM file is a command program)

2) DOS Startup
If you have installed Win98, press Ctrl when the computer starts, and the Start menu appears. Select 5 "command prompt only" to enter the DOS mode.

Currently, our commonly used operating systems include Windows 9x/Me, NT, and 2000, all of which are visualized interfaces. Prior to these systems, people used the DOS system. No one is using the dossystem, but the doscommand still exists in the Windows system we use. Most doscommands have become visualized interfaces in windows, but some advanced doscommands still need to be executed in the DOS environment. Therefore, it is necessary to learn the command line for us to be proficient in Operating Windows systems.

Different operating systems use different commands to enter the command line interface.
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, what is the running program key? Quot; cmd "command to enter the command line interface.
The following doscommands can be executed in the Windows ME operating system.

So how do we enter the command line window?
Start --> Run --> type command --> press ENTER
The command line operation interface (DOS window) is displayed. Only the keyboard can be used in the DOS window.

In dos, you can run the program by entering the English command and the Enter key.

3) DOS system prompt
After DOS is started, "C:>" and a flashing cursor are displayed. This is a DOS system prompt, which indicates the drive letter and directory of the current system, we can enter "[drive letter]:" for conversion, such as "A:" and "E :". Note that the input drive letter must exist.
(Knowledge: drive letter from A to Z, usually drive a and drive B is a soft Drive, drive letter from C, and drive letter is the last)

(4) files and directories
Data in the computer is mainly stored in the form of files. It can also be said that DOS manages data in the form of files.
A file is a collection of related data, and several data together form a file. Each file has a file name. The file name consists of the primary file name and the suffix, separated by small dots. Dos6.22 and earlier versions support a maximum of 8-character primary file names and 3-character suffix names, while Windows 95 dos7.0 supports 128-character primary file names and suffix names. Letters, Chinese characters, numbers, and some special symbols such "! , @, # "Can all be used as file names, but cannot have"/, \, | ,:,? .

We can see the type of the file through the extension name of the file, for example:

Suffix file type
EXE executable program file
COM executable command file
Bat executable batch file
TXT text file
Dat Data File
Bak backup file

To facilitate operations, DOS also allows wildcard characters. The wildcard is "? The two symbols "and" * "can be used to replace some characters in the file name. "? "Represents a valid or empty character, such as" AB? The d.exe file can represent "abcd.exe", "abdd.exe", and "abzd.exe.

"*" Indicates several characters. For example, "*. Bat" indicates all files suffixed with "Bat" in the current directory.
DOS manages disks in the form of a directory tree. The directory here is equivalent to a folder in windows. Like folders, directories form a tree layer by layer. The lowest-level directory in a drive letter is the root directory, and all directories under the root directory are called its subdirectories. The root directory is represented by "\", and the top-level directory of a directory is represented "... We can use the path to find a file or directory. The path is the same as the address, which allows you to conveniently and accurately search. For example, "C: \ WINDOWS \ command \ deltree.exe" is the path of a file.

The internal commands of DOS are the basis for operations. Once you finish learning them, you will jump into the door of the DOS system.

1) dir -- display information of all files or directories in the specified path
The format is "dir [drive letter:] [path] [file name] [parameter]", for example, "dir E: \ ff. m3u ". Enter and press enter to display the relevant information (1 ). In addition, it has several parameters:

/W: display on the wide screen. Five file names are displayed in a row without the modification time, file size, and other information;
/P: displays information by page. You can use it to display information by page;
/A: displays files with special attributes. The attributes include "H" hidden and "R" read-only. You can enter "dir *. */AH "to display all files with hidden properties in the current directory;
/S: displays all the files in the current directory and Its subdirectories. With this parameter, we can search for a file or directory. For example, we can go to "C:> enter "dir *. dat/s to find all files with the suffix dat in drive C.

Several parameters can be used at the same time, such as "dir *. com/W/P/S ".

2) MD -- create a directory
The format is "MD [drive letter] [path]", for example, "MD Temp ".
Note: This command can only create one directory at a time.

3) RD -- delete a directory
The format is "RD [drive letter] [path]".
Note: This command can only delete empty directories and cannot delete the current directory.

4) CD -- enter the specified directory
The format is "CD [path]", for example, "CD happy ".
Note: You can only enter the directory in the current drive letter. "CD \" is returned to the root directory, and "CD .." is returned to the previous directory.

5) copy-copy an object
The format is "copy [Source directory or file] [destination directory or file]", for example, "Copy c :\*. com D: \ ", we can also enter" Copy c: \ command. com D: \ command. bak to copy and rename the file.
Note: When you use this command to copy files, the target directory must exist.

6) del -- delete an object
The format is "del [drive letter] [path] [file name] [parameter]", for example, "del c: \ data \ *. Bak ". It has a parameter: "/P", which enables users to display deletion inquiries for each file when deleting multiple files.

7) Ren -- rename
The format is "Ren [original name] [current name]". In Versions later than 7.0, DOS supports modification of file names and directory names. In the past, DOS only allowed modification of file names.

8) type -- display text files
The format is "type [file name]". You can view text files.

9) discopy -- Disk copy

[Function] copies a disk with the same content as the original disk.

[Format] diskcopy source drive name destination drive name

[Note] its main purpose is to back up data. 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.

10) deltree -- delete 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.

11) MEm -- check the memory size of your computer and the memory usage.

[Format] directly type the mem command

12) chkdsk -- check your disk usage.

[Format] chkdsk disk name

[Note] For example, to check disk A usage, enter chkdsk A: To check disk C usage, enter chkdsk C:. If you directly enter chkdsk, check the usage of the current disk.

13) sys -- pass the system file command. 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.

14) pass -- set the directory where dos searches for. com,. EXE, And. BAT files.

[Format] Path = [[drive:] path [;…] Or path

[Description] Only environment variable content is displayed when path is used and no parameter is set. If there is a parameter, reset the PATH variable. When no path environment variable is specified, the user issues a command. Dos first checks whether it is an internal command and then finds whether the main file name in the current directory is an executable file of the command, if none, "Bad command or FILENAME" is displayed ". If the command for the specified path is issued, search for the path in sequence. If the path still cannot be found, the above prompt is displayed. Http://www.jz5u.com

15) CLS -- clear the content on the screen of the monitor and make the DOS prompt to the upper left corner of the screen.

[Format] CLS

16) Time -- display and set the DOS system time

[Format] time [HH [: Mm [: ss [. CC]

17) date -- display and set the DOS system date

Date [MM-DD-YY] [format]

18) Ver -- display the running DOS system version number

[Format] ver

Common External commands

DOS External commands

DOS External commands are some applications that make your operations more convenient and in-depth. These external commands exist in the form of files. Dos External commands in windows are stored in the "command" directory in the windwos home directory. Next let's take a look at some common dos External commands.

1) format (format. com) -- format command
As we all know, new disks must be formatted before they can be used. The format command can be used to format floppy disks and hard disks. The format is "format [drive letter] [parameter]", for example: "format A:/s ". It has two common parameters:

/Q: perform quick formatting;
/S: complete the formatting and copy the system boot file to the disk.

Note: This command clears all data on the target disk and must be used with caution. If common formatting is performed, the data on the disk may be recovered. However, if "/Q" is added, it is more difficult to restore the data than to last day.

2) edit (edit. com) -- edit command
In fact, it is a text editing software, which can be used to conveniently edit text files in DOS, in the format of "Edit [file name] [parameter]", its parameters are not very practical, so I will not talk about them here.

3) sys (SYS. com) -- system boot file transmission command
It can transmit several files, such as Io. sys, to the target disk so that it can be booted and started. Format: "sys [drive letter]"

4) attrib (attrib. EXE) -- File Attribute setting command
With this command, we can view and change the attributes of the file. The format is "attrib [path] [file name] [parameter]". If no parameter is added, it is the display file attribute. Its Parameters include "+? "And "-? "Two ,"? "Represents the Property Code. These codes are:" H "hidden;" S "system;" R "read-only," + "indicates granting, and"-"indicates removing.

5) xcopy (xcopy. EXE) -- Copy command
This command is enhanced based on "copy" to copy multiple subdirectories. It has many parameters, but is most commonly used "/s". It can copy multiple subdirectories under a directory, and "/E" can copy empty directories. The format is "xcopy [Source Path] [Source directory/file name] [destination directory/file name] [parameter]".

6) Scandisk (Scandisk. EXE) -- Disk scan Program
This command is very useful in actual operations. It can scan and fix disks and solve most disk file damage problems. The format is "Scandisk [drive letter:] [parameter]". The following are its parameters:

/Fragment [drive name: \ path \ file name]: This parameter can be used to show whether the file contains broken blocks. We can solve this problem by running the disk sorting program;
/All: Check and repair all local drives;
/AutoFix;
/Checkonly: Only checks the disk and does not fix the error;
/Custom: Based on Scandisk. to run Scandisk and Scandisk. INI is a text file that contains settings for the Scandisk program. The [custom] block is executed only after the "/custom" parameter is added, users can perform different settings based on their own situations;
/Nosave: directly Delete the lost cluster after checking and does not convert it to a file;
/Nosummary: The check summary is not displayed. After the check is completed, the program will be exited;
/Surface: perform a disk surface scan after completing the preliminary check;
/Mono: Run Scandisk in monochrome format.

We can add different parameters according to different situations. You can run "Scandisk/All/checkonly/nosave/nosummary" to check the disk and exit automatically. You can also edit Scandisk. set in the INI file, and then run "Scandisk/custom ". If there are many damaged files, we can use "/AutoFix" for automatic repair, otherwise you will be busy. Www.jz5u.com

7) chkdsk (chkdsk. EXE) -- disk check Command
It checks the disk and displays a disk status report. The format is "chkdsk [drive letter:] [parameter]". The most common parameter is "/F". You can fix file errors.

8) Move (move. EXE) -- file movement command
You can use it to move files. The format is "Move [source file] [Destination path]". Wildcard characters can also be used.

9) deltree (deltree. EXE) -- delete command
This is a super enhanced version of the del command. It not only deletes files, but also deletes the specified directory and all files and subdirectories under it. You can easily delete directories. In the format of "deltree [file/path] [parameter]", the parameter has a "/Y". When used, the system will ask each file and answer "Y" before deleting it.

10) fdisk (fdisk. EXE) -- partition command
We can use it to partition the hard disk. I will explain it in the next section.

These are commonly used dos External commands, which can make your operations more convenient and are also essential for system repair. Please master every command and its usefulness.

More doscommands

Command function
Ctty Change Control Device
Emm386 extended memory management
Fdisk hard disk partition
LH/loadhigh load the program into high-end memory
Move the file and change the directory name
Prompt setup prompt
Smartdrv sets the disk accelerator
SUBST path replacement
Xcopy copy directories and files
Attrib sets file attributes
Defrag disk Fragment
Doskey calls and creates dos macro commands
Debug program debugging command
FC file comparison
More split-screen display
Vol: displays the specified disk volume number.
Setver version
Set Environment Variables

If you are interested, try these commands in the DOS window.

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.