Note: This article is only for MS-DOS
Chapter 1
DATE Set, display date internal command
TIME Set, display time internal command
VER Display DOS version internal command
PROMPT Change DOS prompt internal command
DATE
Format: DATE
Example: C:\>DATE 9-9-99
Set the system date to September 9, 1999
TIME
Format: TIME
Example: C:\>TIME 9:9
Set the system time to 9:09
VER
Format: VER
Example: C:\>VER
Display DOS version
PROMPT
Format: PROMPT
Description: The symbols provided by the PROMPT command are:
Symbol Generated mark
$T System time
$D System date
$P Current working directory
$V DOS version number
$N Current working drive
$G ">" symbol
$L "<" symbol
Example: C:\>PROMPT $T$G
Chapter 2
FORMAT Format drive external command
SYS Copy system files external command
SCANDISK Check drive for bad sectors external command
DISKCOPY Copy disk external command
FDISK Set, display drive partition external command
BACKUP Backup data external command
RESTORE Read backup data external command
VOL Display drive label internal command
LABEL Set drive label external command
FORMAT Format drive
Format: FORMAT
Example: C:\>FORMAT a:/S
Format the disk in drive a and copy the boot system file so that the disk has boot capability and create a root directory in drive a.
SYS Copy system files
Format: SYS
Example: C:\> SYS a:
Copy the boot system file to the disk in drive a to make it bootable.
SCANDISK Check drive for bad sectors
Format: SCANDISK
Example: C:\> SCANDISK D:
Check drive D for bad sectors
DISKCOPY Copy disk
Format: DISKCOPY
Example: C:\>DISKCOPY A: B:
Completely copy the contents of drive a disk to drive b disk.
FDISK Set, display drive partition
Format: FDISK
Description: Plan the partition for a new hard drive.
Example: C:\>FDISK
BACKUP Backup data
Format: BACKUP D:
Example: C:\> BACKUP C:\PE2\*.* A:
Backup the data in the PE2 directory on drive C to drive A.
RESTORE Read backup data
Format: RESTORE
Example: C:\> RESTORE A: C:\PE2\*.*
Read the backup file.
VOL Display drive label
Format: VOL
Example: C:\> VOL C:
Display the label of drive C
LABEL Set drive label
Format: LABEL
Example: C:\>LABELL C: MAIN
Set the label of drive C to MAIN
Chapter 3
COPY File copy internal command
XCOPY File copy (can include subdirectories) external command
DEL(ERASE) Delete file internal command
DELTREE Delete all files in a directory (including subdirectories) external command
RENAME Change file name internal command
TYPE Display file content internal command
MORE Page display file content external command
PRINT Print file external command
ATTRIB Set, display file attributes external command
MOVE Move file location external command
COPY File copy
Format: COPY source file name destination file name
Example: C:\>COPY C:\1.TXT D:\2.TXT
Copy the file C:\1.TXT to drive D and name it 2.TXT
XCOPY File copy (can include subdirectories)
Format: XCOPY source file name destination file name
Example: C:\>XCOPY C:\DOS\*.* A: /s
Copy the files in the C:\DOS directory (including subdirectories) to drive A.
DEL Delete file
Format: DEL file
Example: C:\>DEL A:*.*
Delete the files in drive A (excluding subdirectories)
Note: If the disk is in write-protected state, a Write Protected error message will appear.
DELTREE Delete all files in a directory (including subdirectories)
Format: DEL path
Example: C:\>DEL A:
Delete all files in the root directory of drive A (including subdirectories, but excluding hidden files)
RENAME Change file name
Format: REN old file name new file name
Example: C:\>REN 1.TXT 2.TXT
Rename 1.TXT to 2.TXT
TYPE Display file content
Format: TYPE file name
Example: C:\>TYPE 1.TXT
Display the content of 1.TXT on the screen.
C:\>TYPE 1.TXT > LPT
Display the content of 1.TXT to LPT (printer), that is, print 1.TXT.
C:\>TYPE 1.TXT >2.TXT
Redirect the content of 1.TXT to 2.TXT, which is equivalent to COPY 1.TXT 2.TXT
MORE Page display file content
Format: MORE file name
Example: C:\>MORE 1.TXT
If the file content is too much, you can use the MORE command to make the computer display only one page of content at a time.
PRINT Print file
Format: PRINT file name
Example: C:\>PRINT 1.TXT
Print the content of 1.TXT.
ATTRIB Set, display file attributes
Format: ATTRIB file name
Description: R: Read-only A: Archive S: System H: Hidden
Example: C:\>ATTRIB -H 1.TXT
Set 1.TXT as a hidden file.
MOVE Move file location
Format: MOVE file name file name
Example: C:\>MOVE \AAA\1.TXT \BBB
Move 1.TXT in the AAA directory to the BBB directory.
Chapter 4
MD(MKDIR) Create directory internal command
CD(CHDIR) Change directory internal command
RD(RMDIR) Delete subdirectory internal command
PATH Set search path internal command
TREE List directory tree structure external command
MD(MKDIR) Create directory
Format: MD directory name
Example: C:\>MD TEMP
Create a directory named TEMP.
CD(CHDIR) Change directory
Format: CD directory name
Example: C:\>CD \ET3\TEMP
Change the working directory to the TEMP directory under the ET3 directory under the root directory.
RD(RMDIR) Delete subdirectory
Format: RD directory name
Example: C:\>RD \ET3\TEMP
Delete the TEMP subdirectory under the ET3 directory under the root directory, but there must be no other files in the TEMP subdirectory.
PATH Set, display DOS search path for executable files
Format: PATH path path]]
Example: C:\>PATH C:\; C:\DOS; C:\ET3
Set the search path for executable files to C:\, C:\DOS and C:\ET3
TREE List directory tree structure
Format: TREE
Example: C:\>TREE
Display the directory tree structure under the C root directory.
Chapter 5
MEM Display current memory usage external command
MEM Display current memory usage
Format: MEM ‧‧‧
Example: C:\>MEM /C
Chapter 1
DATE Set, display date internal command
TIME Set, display time internal command
VER Display DOS version internal command
PROMPT Change DOS prompt internal command
DATE
Format: DATE
Example: C:\>DATE 9-9-99
Set the system date to September 9, 1999
TIME
Format: TIME
Example: C:\>TIME 9:9
Set the system time to 9:09
VER
Format: VER
Example: C:\>VER
Display DOS version
PROMPT
Format: PROMPT
Description: The symbols provided by the PROMPT command are:
Symbol Generated mark
$T System time
$D System date
$P Current working directory
$V DOS version number
$N Current working drive
$G ">" symbol
$L "<" symbol
Example: C:\>PROMPT $T$G
Chapter 2
FORMAT Format drive external command
SYS Copy system files external command
SCANDISK Check drive for bad sectors external command
DISKCOPY Copy disk external command
FDISK Set, display drive partition external command
BACKUP Backup data external command
RESTORE Read backup data external command
VOL Display drive label internal command
LABEL Set drive label external command
FORMAT Format drive
Format: FORMAT
Example: C:\>FORMAT a:/S
Format the disk in drive a and copy the boot system file so that the disk has boot capability and create a root directory in drive a.
SYS Copy system files
Format: SYS
Example: C:\> SYS a:
Copy the boot system file to the disk in drive a to make it bootable.
SCANDISK Check drive for bad sectors
Format: SCANDISK
Example: C:\> SCANDISK D:
Check drive D for bad sectors
DISKCOPY Copy disk
Format: DISKCOPY
Example: C:\>DISKCOPY A: B:
Completely copy the contents of drive a disk to drive b disk.
FDISK Set, display drive partition
Format: FDISK
Description: Plan the partition for a new hard drive.
Example: C:\>FDISK
BACKUP Backup data
Format: BACKUP D:
Example: C:\> BACKUP C:\PE2\*.* A:
Backup the data in the PE2 directory on drive C to drive A.
RESTORE Read backup data
Format: RESTORE
Example: C:\> RESTORE A: C:\PE2\*.*
Read the backup file.
VOL Display drive label
Format: VOL
Example: C:\> VOL C:
Display the label of drive C
LABEL Set drive label
Format: LABEL
Example: C:\>LABELL C: MAIN
Set the label of drive C to MAIN
Chapter 3
COPY File copy internal command
XCOPY File copy (can include subdirectories) external command
DEL(ERASE) Delete file internal command
DELTREE Delete all files in a directory (including subdirectories) external command
RENAME Change file name internal command
TYPE Display file content internal command
MORE Page display file content external command
PRINT Print file external command
ATTRIB Set, display file attributes external command
MOVE Move file location external command
COPY File copy
Format: COPY source file name destination file name
Example: C:\>COPY C:\1.TXT D:\2.TXT
Copy the file C:\1.TXT to drive D and name it 2.TXT
XCOPY File copy (can include subdirectories)
Format: XCOPY source file name destination file name
Example: C:\>XCOPY C:\DOS\*.* A: /s
Copy the files in the C:\DOS directory (including subdirectories) to drive A.
DEL Delete file
Format: DEL file
Example: C:\>DEL A:*.*
Delete the files in drive A (excluding subdirectories)
Note: If the disk is in write-protected state, a Write Protected error message will appear.
DELTREE Delete all files in a directory (including subdirectories)
Format: DEL path
Example: C:\>DEL A:
Delete all files in the root directory of drive A (including subdirectories, but excluding hidden files)
RENAME Change file name
Format: REN old file name new file name
Example: C:\>REN 1.TXT 2.TXT
Rename 1.TXT to 2.TXT
TYPE Display file content
Format: TYPE file name
Example: C:\>TYPE 1.TXT
Display the content of 1.TXT on the screen.
C:\>TYPE 1.TXT > LPT
Display the content of 1.TXT to LPT (printer), that is, print 1.TXT.
C:\>TYPE 1.TXT >2.TXT
Redirect the content of 1.TXT to 2.TXT, which is equivalent to COPY 1.TXT 2.TXT
MORE Page display file content
Format: MORE file name
Example: C:\>MORE 1.TXT
If the file content is too much, you can use the MORE command to make the computer display only one page of content at a time.
PRINT Print file
Format: PRINT file name
Example: C:\>PRINT 1.TXT
Print the content of 1.TXT.
ATTRIB Set, display file attributes
Format: ATTRIB file name
Description: R: Read-only A: Archive S: System H: Hidden
Example: C:\>ATTRIB -H 1.TXT
Set 1.TXT as a hidden file.
MOVE Move file location
Format: MOVE file name file name
Example: C:\>MOVE \AAA\1.TXT \BBB
Move 1.TXT in the AAA directory to the BBB directory.
Chapter 4
MD(MKDIR) Create directory internal command
CD(CHDIR) Change directory internal command
RD(RMDIR) Delete subdirectory internal command
PATH Set search path internal command
TREE List directory tree structure external command
MD(MKDIR) Create directory
Format: MD directory name
Example: C:\>MD TEMP
Create a directory named TEMP.
CD(CHDIR) Change directory
Format: CD directory name
Example: C:\>CD \ET3\TEMP
Change the working directory to the TEMP directory under the ET3 directory under the root directory.
RD(RMDIR) Delete subdirectory
Format: RD directory name
Example: C:\>RD \ET3\TEMP
Delete the TEMP subdirectory under the ET3 directory under the root directory, but there must be no other files in the TEMP subdirectory.
PATH Set, display DOS search path for executable files
Format: PATH path path]]
Example: C:\>PATH C:\; C:\DOS; C:\ET3
Set the search path for executable files to C:\, C:\DOS and C:\ET3
TREE List directory tree structure
Format: TREE
Example: C:\>TREE
Display the directory tree structure under the C root directory.
Chapter 5
MEM Display current memory usage external command
MEM Display current memory usage
Format: MEM ‧‧‧
Example: C:\>MEM /C
