Microsoft DOS (Disk Operating System) and Windows Command Line are command-line interfaces that allow users to interact with the operating system by entering text commands. Here are some basic commands that you can use in both systems:
- cd – Change directory: This allows you to change the current working directory.
- Syntax: cd [directory name]
- Example: cd Documents
- dir – List directory contents: Displays a list of files and subdirectories in the current directory.
- Syntax: dir
- Example: dir
- type – Display file contents: Displays the contents of a text file on the screen.
- Syntax: type [filename]
- Example: type myfile.txt
- copy – Copy files: Allows you to copy one or more files from one location to another.
- Syntax: copy [source filename] [destination filename]
- Example: copy myfile.txt backup\myfile.txt
- move – Move files: Allows you to move files from one location to another.
- Syntax: move [source filename] [destination filename]
- Example: move myfile.txt backup\myfile.txt
- del – Delete files: Allows you to delete one or more files.
- Syntax: del [filename]
- Example: del myfile.txt
- md – Make directory: Allows you to create a new directory.
- Syntax: md [directory name]
- Example: md newfolder
- rd – Remove directory: Allows you to remove an empty directory.
- Syntax: rd [directory name]
- Example: rd oldfolder
- cls – Clear screen: Clears the screen of all text.
- Syntax: cls
- Example: cls
- exit – Exit command prompt: Closes the command prompt window.
- Syntax: exit
- Example: exit
the top 10 MS-DOS commands:
- dir – Lists the contents of a directory. Syntax:
dir
- cd – Changes the current directory. Syntax:
cd [directory name]
- md – Creates a new directory. Syntax:
md [directory name]
- rd – Removes an empty directory. Syntax:
rd [directory name]
- copy – Copies files from one location to another. Syntax:
copy [source file] [destination file]
- del – Deletes a file. Syntax:
del [file name]
- format – Formats a disk. Syntax:
format [drive letter:]
- chkdsk – Checks the file system and file system metadata of a disk for errors. Syntax:
chkdsk [drive letter:]
- tree – Displays the folder structure of a directory and its subdirectories. Syntax:
tree [directory name]
- help – Displays a list of available MS-DOS commands. Syntax:
help
How to use the Windows command line (DOS)
To use the Windows command line (DOS), follow these steps:
- Open the command prompt: Click on the “Start” menu, type “cmd” in the search bar, and press enter. Alternatively, you can press the Windows key + R to open the “Run” dialog box, type “cmd” and press enter.
- Navigate to the directory where you want to execute the command: Use the “cd” command followed by the path to the directory you want to navigate to. For example, to navigate to the “Documents” folder on your C drive, type “cd C:\Users\yourusername\Documents” and press enter.
- Enter a command: Type the command you want to execute and press enter. For example, to list the contents of the current directory, type “dir” and press enter.
- Review the output: The output of the command will be displayed in the command prompt window. If there is a lot of output, you can use the scroll bar on the right side of the window to scroll up and down.
- Repeat steps 2-4 as necessary: You can navigate to different directories and execute different commands as needed.
- Exit the command prompt: When you are finished using the command prompt, type “exit” and press enter to close the window.
Some common commands you can use in the Windows command line include “dir” to list the contents of a directory, “cd” to change the current directory, “mkdir” to create a new directory, “type” to display the contents of a file, “copy” to copy files, and “del” to delete files. You can use the “help” command to see a list of all available commands, and you can use the “/?” switch with a command to see the syntax and options for that command.