Common Commands in DOS
(I) MD -- Create Subdirectory
1. Function: Create a new subdirectory
2. Type: Internal command
3. Format: MD <subdirectory name>
4. Usage instructions:
(1) "Drive": Specify the disk drive letter where the subdirectory is to be created. If omitted, it is the current drive;
(2) "Pathname": The name of the upper-level directory of the subdirectory to be created. If omitted, it is created in the current directory.
Example: (1) Create a subdirectory named FOX under the root directory of drive C; (2) Create a USER subdirectory under the FOX subdirectory.
C:> MD FOX (Create subdirectory FOX under current drive C)
C:> MD FOX\USER (Create USER subdirectory under FOX subdirectory)
(II) CD -- Change Current Directory
1. Function: Display the current directory
2. Type: Internal command
3. Format: CD
4. Usage instructions:
(1) If the path and subdirectory name are omitted, the current directory is displayed;
(2) If the format "CD\" is used, it returns to the root directory;
(3) If the format "CD.." is used, it returns to the upper-level directory.
Example: (1) Enter the USER subdirectory; (2) Return from the USER subdirectory to the upper-level directory; (3) Return to the root directory.
C:> CD FOX\USER (Enter USER subdirectory under FOX subdirectory)
C:>FOX\USER> CD.. (Return to upper-level root directory)
C:>FOX> CD\ (Return to root directory)
C:>
(III) RD -- Delete Subdirectory Command
1. Function: Delete a directory from the specified disk.
2. Type: Internal command
3. Format: RD
4. Usage instructions:
(1) The subdirectory must be empty before deletion, that is, you need to enter the subdirectory first, use DEL (the command to delete files) to empty the files under the subdirectory, then return to the upper-level directory, and use the RD command to delete the subdirectory itself;
(2) The root directory and the current directory cannot be deleted.
Example: Requirement: Delete the USER subdirectory under the FOX subdirectory on drive C. The operation is as follows:
Step 1: First empty the files under the USER subdirectory;
C:> DEL C:\FOX\USER\*.*
Step 2: Delete the USER subdirectory.
C:> RD C:\FOX\USER
(IV) DIR -- Display Disk Directory Command
1. Function: Display the content of the disk directory.
2. Type: Internal command
3. Format: DIR
4. Usage instructions: Use of /P; When there are too many directories to view and they cannot be displayed completely on one screen, the screen will keep scrolling up, which is not easy to see. After adding the /P parameter, the file information of 23 lines will be displayed page by page on the screen, then paused, and prompt: Press any key to continue
Use of /W: Adding /W only displays the file names, and the file size, creation date and time are all omitted. After adding the parameter, five file names can be displayed per line.
PATH -- Path Setting Command
1. Function: Set the search path for executable files, only valid for files.
2. Type: Internal command
3. Format: PATH directory{<directory pathname2>...}
4. Usage instructions:
(1) When running an executable file, DOS will first search for the file in the current directory. If found, it will run it; if not found, it will search for the file in the directories set by the PATH command in sequence one by one;
(2) The paths in the PATH command, if there are two or more, are separated by a semicolon ";" between each path;
(3) The PATH command has three usage methods:
PATH... (Set the search path for executable files)
PATH: (Cancel all paths)
PATH: (Display the currently set path)
(VI) TREE -- Display Disk Directory Structure Command
1. Function: Display all directory paths on the specified drive and all file names under these directories.
2. Type: External command
3. Format: TREE
4. Usage instructions:
(1) When using the /F parameter, all directories and all files under the directories are displayed. When omitted, only directories are displayed, and files under the directories are not displayed;
(2) When using the >PRN parameter, the listed directories and file names in the directories are printed out.
(VII) DELTREE -- Delete Entire Directory Command
1. Function: Delete the entire directory and its subordinate subdirectories and files.
2. Type: External command
3. Format: DELTREE<pathname>
4. Usage instructions: This command can delete the directory and all files, subdirectories, and lower-level subdirectories under it in one step. Moreover, regardless of whether the file attributes are hidden, system or read-only, as long as the file is under the deleted directory, DELTREE will delete it without distinction. Be extremely careful when using it!!!
Just found it,,, hope everyone likes it,,,, thank you!!!!!!!!!!