The document provides a cheatsheet of common Windows Command Prompt commands and their usage. It lists commands for navigating directories, creating/deleting files and folders, copying/moving files, displaying file contents, and more. Each command is accompanied by a brief explanation of its functionality and syntax examples to execute the command. The cheatsheet serves as a quick reference guide for basic file management and program execution tasks using the Windows Command Prompt.
The document provides a cheatsheet of common Windows Command Prompt commands and their usage. It lists commands for navigating directories, creating/deleting files and folders, copying/moving files, displaying file contents, and more. Each command is accompanied by a brief explanation of its functionality and syntax examples to execute the command. The cheatsheet serves as a quick reference guide for basic file management and program execution tasks using the Windows Command Prompt.
- Command line interface (as opposed to a GUI - graphical user interface)
- Used to execute programs - Commands are small programs that do something useful - There are many commands already included with Windows, but we will use a few. - A filepath is where you are in the filesystem C: is the C drive C:\user\Documents is the Documents folder C:\user\Documents\hello.c is a file in the Documents folder
Command What it Does Usage
dir Displays a list of a folders files dir (shows current folder)
and subfolders dir myfolder cd Displays the name of the current cd filepath chdir directory or changes the current chdir filepath folder. cd .. (goes one directory up) md Creates a folder (directory) md folder-name mkdir mkdir folder-name rm Deletes a folder (directory) rm folder-name rmdir rmdir folder-name rm /s folder-name rmdir /s folder-name Note: if the folder isnt empty, you must add the /s. copy Copies a file from one location to copy filepath-from filepath-to another move Moves file from one folder to move folder1\file.txt folder2\ another ren Changes the name of a file ren file1 file2 rename del Deletes one or more files del filename exit Exits batch script or current exit command control echo Used to display a message or to echo message turn off/on messages in batch scripts type Displays contents of a text file type myfile.txt fc Compares two files and displays fc file1 file2 the difference between them cls Clears the screen cls help Provides more details about help (lists all commands) DOS/Command Prompt help command commands