The document provides a cheatsheet of common Windows command prompt commands, explaining what each command does and its basic usage. It lists commands like dir, cd, md, rmdir, copy, move, ren, del, echo, type, fc, cls, and help along with brief descriptions of their functions.
The document provides a cheatsheet of common Windows command prompt commands, explaining what each command does and its basic usage. It lists commands like dir, cd, md, rmdir, copy, move, ren, del, echo, type, fc, cls, and help along with brief descriptions of their functions.
- 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 lepath is where you are in the lesystem • C: is the C drive • C:\user\Documents is the Documents folder • C:\user\Documents\hello.c is a le in the Documents folder
Command What it Does Usage
dir Displays a list of a folder’s les dir (shows current folder)
and subfolders dir myfolder cd Displays the name of the current cd lepath chdir directory or changes the current chdir lepath 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 isn’t empty, you must add the /s. copy Copies a le from one location to copy lepath-from lepath-to another move Moves le from one folder to move folder1\le.txt folder2\ another ren Changes the name of a le ren le1 le2 rename del Deletes one or more les del lename 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 le type myle.txt fc Compares two les and displays fc le1 le2 the difference between them cls Clears the screen cls help Provides more details about help (lists all commands) DOS/Command Prompt help command commands