
Today, most users ignore the
Windows Command Prompt, as we can perform just about anything using the graphical interface. Its easier, right? Well, why does Windows keep its prompt, then?
Although its almost 50 years old, it is not outdated. On the contrary, its very popular, and many find it
incredibly useful. It has stood the test of time, so its existence is a sufficient reason to get familiar with it. It is the best way to perform many tasks, even in the modern age. Moreover, its pretty easy to use.
So, lets get right to it! Well explain the basics of the command prompt Window, teach you how to open the Windows prompt command line, and give you
a cheat sheet of the most popular CMD commands and what they do in more detail.
What Is Windows Command Line?A command prompt or prompt is
a command-line interface (CLI), a text-based user interface (UI) that enables you to perform various tasks within an OS or a program. For instance, you can interact with your computer, manage files and directories, run programs, script, automate, or perform other basic and advanced tasks.
Some operating systems provide you with a CLI exclusively, while others might grant you both a CLI and a GUI.
The Command Prompt or
cmd.exe is
the default command-line interpreter in Microsoft Windows, OS/2, eComStation, ArcaOS, and ReactOS operating systems. More precisely, it executes the commands you input in the Windows OS, like Terminal on macOS and Shell on Unix-based systems.
Both CLIs and GUIs are shells, programs that enable you to give commands to the computer. However, a CLI differs from a
GUI, as the
Graphical User Interface allows you to interact with the system using graphical elements, such as icons or menus, instead of text.
History of CMD CommandsText-based commands go back to the existence of the Windows PC. Users could operate early Windows operating systems exclusively through CLIs; they didnt have the mouse cursor or similar GUI elements.
Question: When did the CMD commands become available?
Answer: The Windows Prompt became available in December 1987. Virtually, Microsoft hasnt changed its design since then. Yet, we officially recognize them as CMD commands in Windows 10, 8, 7, Vista, and XP.
The commands in earlier versions, including Windows 98/95, were known as DOS commands. Up to the 2000s, Windows versions included the MS-DOS integration, and clients ran commands using the MS-DOS Prompt. Later,
starting with Windows XP in 2001, it was renamed Command Prompt.
Why Would You Use The Command Prompt?Many customers havent even touched the Windows Command Prompt because
modern, streamlined operating systems remove the need for old-school text commands. And sure, it might feel inconvenient to perform some tasks, such as managing files and folders using the command line, especially if you are used to the GUI.
Still, the command line is
incredibly handy for many tasks, such as checking your IP address. Moreover, while it works at a basic level, the CMD is, in reality,
the more powerful alternative.
It translates dozens of clicks in the GUI into a single line, thus
shortening the time it takes to execute a new task. Power users also prefer it because it grants them
more control over their computers and
establishes direct communication.
Using the command window, you can perform
advanced tasks, such as creating shortcuts to pin to the taskbar, accessing vital information, managing security issues, or fixing faults in Windows. Moreover, you can
access parts of the operating system that are unavailable through the graphical user interface.
Last but not least, some of these commands
apply to Linux, macOS, and many other operating systems, not only the Windows environment. So, learning them once may also benefit you in the future, even if you switch to another OS.
How To Open the Windows Command Line?You can open the Command Prompt in Windows in a few ways: Start Menu > Type command prompt > Press Enter

Start Menu > Type cmd > Press Enter

Press Win + R > Type cmd > Press Enter

Right-click the Start Menu > Choose Command Prompt
Press Win + X > Choose Command Prompt
The Command Prompt in the Start Menu might also appear as
Windows PowerShell or
Windows Terminal, depending on your Windows settings. Both are more powerful yet compatible with CMD
commands.

Yet, remember that some commands require
administrator access. To open a command prompt and perform some of the commands, make sure to choose the Admin option from the menu. For the other ways to open the CMD, hold Ctrl + Shift to get admin permission when you launch.
How To Use the Windows Command Line?As soon as you open the command prompt, youll immediately learn a lot.
The first line shows you your Windows version. In my case, thats 10.0.19045.2486. Also, pay attention to the third line, i.e.,
C:\Users\[Username]>. It refers to the Windows user and tells you where your commands will take place if CMD relies on location. Some CMD commands, however, are general. So, your location wont matter.
Question: How many commands are there in CMD?
Answer: While the exact number of commands differs according to your Windows version, you can use approximately 100 commands.
The commands are
not case-sensitive. Yet, as you are issuing them directly, try to
type in the command correctly. Otherwise, the system wont be able to understand you. But worry not; you cannot do much harm with a typo. If Windows doesnt recognize the command, youll get a message saying:
[Command] is not recognized as an internal or external command, operable program, or batch file.
However, typing the wrong command sure does some damage. If Windows recognizes the command, it will execute it immediately. So, it would be best to
take your time and double-check everything. Moreover, avoid using the admin Command Prompt unless necessary.
Windows Command Prompt Cheat SheetFinally, we come to the most used commands in Windows OS. You can keep the list open on your desktop or print it; either way, keep it near to make the most out of CMD without feeling overwhelmed.
Basic CommandsEven if you have never used the command prompt window, some of its commands are welcoming to beginners.
Heres a quick summary to help you
start with the basics and build your knowledge:
Any command/?: Gives you information about the specific command and what it does
ARROW DOWN: Enables you to move forward in history toward the most recent command
ARROW UP: Enables you to step through the last called commands from the most recent one
call: Tells batch programs from one another
cd (change directory): Displays the name of or changes the current directory
chkdsk: Scans a disk for errors and delivers a status report
cls: Clears the contents of the Command Prompt
color: Applies the default console colors
Ctrl+A: Moves the caret to the beginning of the line
Ctrl+C: Cancels a command you are running
Ctrl+E: Moves the caret to the end of the line
Ctrl+K: Deletes all characters after the caret
Ctrl+L: Clears the screen
Ctrl+U: Deletes all characters before the caret
date: Displays or sets the date
del [file name]: Deletes the selected file
dir (directory): Lists all the files and subdirectories in the directory you are currently in
echo: Presents messages or turns command-echoing on/off.
exit: Quits the current echo setting or the CMD.EXE program
find: Searches for a text string in one or multiple files
help: Lists many common commands you can use
hostname: Prints the name of the current host
ipconfig: Provides a network overview for your current connection
mkdir [new folder name] (make directory): Creates a new folder
pause: Suspends processing of a batch program and displays the message
ping: Checks if your computer can reach a remote destination and how long it will take
prompt: Specifies a new command prompt
rmdir [folder name] (remove directory): Deletes an entire folder if its empty
sfc: Windows detects and fixes corrupt system files *you need admin access
TAB: Autocompletes what you have been writing
title: Sets the window title for the command prompt window
Once you get familiar with the basics, its time to take your skill to the next level. Lets overview
the most popular CMD commands for different tasks on Windows.
Files & Folders Commands
assoc: Displays or modifies file extension associations
attrib: Displays or changes file attributes
comp: Compares the contents of two files or sets of files
compact: Displays or alters the compression of files on NTFS partitions
expand: Expands one or more compressed files
fc: Compares two files or sets of files and displays their differences
find: Searches for a text string in one or multiple files
findstr: Searches for string patterns in files
md: Creates a directory
move: Moves and renames files and directories
openfiles: Lists or disconnects files and folders opened on a system *you need admin access
print: Prints a text file
ren (rename): Renames one or multiple files
replace: Replaces files
robocopy: Creates robust file copy for Windows
tree: Graphically displays the selected folder structure of a drive or path
type: Displays the contents of one or more text files
xcopy: Copies files and directory trees
Disk & Partition Commands
chkdsk: Checks a disk and displays a report
chkntfs: Displays or modifies the checking of the disk at boot time
convert: Converts a FAT volume to NFTS
format: Formats a disk for use with Windows
label: Creates, changes, or deletes the volume label of a disk
recover: Recovers readable information from a bad or defective disk
vol: Displays the disk volume label and serial number, if they exist
Network Commands
arp: Displays and modifies the IP to physical address translation tables used by ARP (Address
Resolution Protocol)
bitsadmin: Creates, uploads, or downloads jobs and monitors their progress
ftp: Transfers files to and from a computer running an FTP server service
ftype: Displays or modifies file types used in file extension associations
netsh: Configures, controls, and displays network components
netstat: Displays protocol statistics and current TCP/IP network connections
route: Manipulates network routing tables
systeminfo: Displays OS configuration information for a local or remote machine, including service pack levels
System Information & Configuration Commands
driverquery: Enables you to display a list of installed device drivers *you need admin access
powercfg: Enables you to control power settings on a local system
shutdown: Turns off computer
time: Displays or sets the system time
ver: Displays the Windows version
If you want to run multiple commands, combining them instead of waiting for them to complete one after another will save you a lot of time. To
combine commands, separate them with a semicolon (

on the same line.
Moreover, you can use
the only if option. You can link the command to its predecessor. If the command follows &&, it will complete only if the previous command is completed successfully as well. On the contrary, if the command follows ||, it will complete only if the previous command has failed.
And if this is not enough and you want to take your knowledge on related topics to the next level,
visit the official Microsoft page for a list of all commands with detailed explanations in alphabetical order.
How To View Your Command Prompt Window History?One of the main disadvantages of the Command Prompt is that
it only records data from the active session. So, if you have performed commands and rebooted your computer, in theory, you will be unable to review what you have done.
Fortunately, there are a few hacks, and weve decided to include them as extras in our Windows command prompt cheat sheet.
First, you can
use the keyboard shortcut:
Open a command prompt
Run commands
Press the F7 key
Check the list of recent commands
Press the one you want to execute again
Hit enter
Second, you can
search the command history:
Open a command prompt
Execute commands
Press the F7 key
Check the list of recent orders
Press the F8 key
Type what you remember from the line
Press the F8 key again
If you dont like the result, press the F8 key again to view another entry
Next, you can
use the doskey:
Launch the Prompt
Type doskey/history
It will enable you to recall previously typed commands, edit command lines, or even create macros.
Last but not least, you can
export your prompt history to file:
Run the CMD as an Administrator
Type doskey /h > c:\cmd_history.txt
Change the c:\cmd_history.txt to represent the file path and name you want to export your current history to
The Next Step: Windows PowerShellPowerShell is an alternative to the Windows Command Prompt. It consists of a command-line shell, a scripting language, and a configuration management framework and is compatible with Windows, Linux, and macOS.
Question: When was PowerShell released?
Answer: Microsoft released PowerShell 1.0 in November 2006 for Windows XP SP2, Windows Server 2003 SP1, and Windows Vista.
Initially, the company released PowerShell as an optional component with many useful commands, known as
cmdlets. Their goal was to integrate the cmdlets better with their offerings, for them to batch files and VB scripts.
But, just recently, the company also announced that
PowerShell is replacing the CMD.EXE. Fortunately, you can still use the Command Prompt if you prefer.
Windows Command Prompt vs. Windows PowerShellPowerShell is the
more advanced and the latest version of the Command Prompt. It enables you to execute more or less the same commands as CMD. At the same time, it facilitates carrying out administrative tasks.
Lets review a few of their differences briefly so that you can understand both applications better.
Command Prompt: Works with Batch commands exclusively
You cannot create aliases for commands
You cannot pass the output from a command on to other commands
Output comes out in the form of text
No separate ISE
Requires an external plugin for WMI interaction
It doesnt support Linux OS
You can only run console-type programs
It cannot connect to Microsoft cloud products
PowerShell: Works with Batch commands and PowerShell cmdlets
You can create aliases for cmdlets or scripts
You can pass the output from a cmdlet on to other cmdlets
Output comes out in the form of an object
Has a separate ISE
It can integrate directly with WMI
Fully supports Linux OS
You can run all types of programs
It can connect to Microsoft Cloud products
So, which one should you learn? It depends on your needs. PowerShell is a relatively new product. It is
easy to interpret, provides more compatibility and options, and you can expect a lot of advancements promptly. On the other hand, you can perform most of the tasks using the
old-school and all-timer CMD.
ConclusionWhile an unpopular opinion, the CMD is, in fact, much
more powerful than a GUI. Better yet, its not only intended for experienced or advanced users. Its quite the contrary. The Windows prompt is
equally suitable for newcomers, as its
time-efficient and easy to use.
The bottom line is that learning about the Windows command prompt is worth it. And our Windows command prompt cheat sheet is the perfect place to start and
get the most out of your Windows experience!
source