Common DOS Commands Daquan

Source: Internet
Author: User

The biggest difference between DOS and Windows is the DOS command, so the user needs to remember a lot of commands and how to use them, and DOS commands are divided into internal commands and external commands. Internal commands are mounted and resident memory with each boot command.com, and the external command is a separate executable file. Keep in mind that internal commands can be used at all times, and external commands need to ensure that the command file is in the current directory, or that the Autoexec.bat file has been loaded in the path.

  Common internal commands

DOS internal commands are the basis of DOS operation, here are some common DOS internal commands.

  1, DIR

Meaning: Displays information about all files or directories on the specified path

Format: DIR [letter:] [path] [filename] [parameters]

Parameters:

/w: Widescreen display, a row of 5 file names, and will not show the modified time, file size and other information;

/p: Pagination shows that when the screen is unable to fully display the information, you can use it for paging;

/A: Displays files with special attributes;

/S: Displays all files under the current directory and its subdirectories.

Example: dir/p

Displays the files in the current directory in a split screen. At the end of the current screen, there is a "press any key to continue ..." prompt indicating that pressing any key continues.

  2, CD

Meaning: Enter the specified directory

Format: CD [path]

Example: CD DOS

The CD command can only enter the directory in the current disk, where "CD" is returned to the root directory, "CD ..." To return to the previous level of the directory.

  3, MD

Meaning: Create a directory

Format: MD [disk character] [path]

Example: MD TEMP

Indicates that a directory named TEMP is established under the current disk character.

  4, RD

Meaning: Delete directory

Format: RD [disk] [path]

Example: RD TEMP

Indicates that the temp directory under the current path is deleted, and it should be noted that this command can only delete empty directories.

  5, COPY

Meaning: Copying files

Format: COPY [source directory or file] [destination directory or file]

For example 1:copy c:*.com D: "To copy all files with COM in the C-packing directory to the D-Packing directory."

Example 2:copy C:autoexec.bat C:autoexec.bak

Indicates that the Autoexec.bat file is copied to a file with the extension bak. Enter the dir command to discover this change.

  6, DEL

Meaning: Deleting files

Format: DEL [disk] [path] [filename] [parameters]

Example: DEL C: *. bak/p

Indicates that all files with the extension bak in the current directory are deleted, and the parameter/p representation allows the user to display a delete query for each file when multiple files are deleted.

  7, SYS

Meaning: Passes system file commands.

Format: SYS [Source letter] [Destination letter]

For example: SYS c:a:

This command will be a disk transfer system, after the transfer is successful, a disk will become the system boot disk.

  Common external commands

The external commands for DOS are applications that are in the form of files, and Windows system DOS commands are stored in the command directory in the Windows home directory. Here are a few common dos external commands.

  1, EDIT

Meaning: Simple editing software that you can use to edit some programs and batch files.

Format: EDIT [letter] [filename]

Example: EDIT c:autoexec.bat

When you enter this command, the editor opens. After entering the contents of the file in the editing state, press Alt+f to activate the File menu, press the down arrow to select Exit (exit), and indicate whether you want to save the content just entered, if you want to save, just enter Y or direct return.

  2. FORMAT

Meaning: Formatting commands that can be used to format floppy disks and hard disks.

Formatting: format [letter] [parameters]

Example: FORMAT A:/s/q

This command formats a disk, where the parameter/Q representation is quickly formatted,/s means that the system boot file is copied to the disk after the format is finished so that the software can be used as the DOS system boot disk. During the formatting process, the percentage that has been completed is displayed on the screen. When the format is complete, you will be prompted for a name for the disk, and the total space and available space for the disk will be reported finally.

  3. XCOPY

Meaning: Copy command

Format: XCOPY [Source path] [source directory/filename] [destination directory/filename] [parameters]

Example: XCOPY c:abc D:/S

After this command is executed, all files in the C:ABC directory and its directory are copied to the D-packing directory, and Xcopy is a copy-enhanced command that enables copies of multiple subdirectories. The most commonly used parameter is/S, which copies all subdirectories in a directory.

  4, deltree

Meaning: Delete a directory tree

Format: deltree [disk character] [path]

Example: deltree ARE

Deletes the are subdirectory under the current path, prompts to confirm deletion after execution, and press Y to remove.

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.