12736123, 722 AM Command Line Commands ~ CLI Tutorial
Donate
Command Line Commands -
CLI Tutorial
é Kolade Chris
The Windows command line is one of the most powerful
utilities on a Windows PC. With it, you can interact with
the OS directly and do a lot of things not available in the
graphical user interface (GUI).
hitpsswwwreecodecamp,orginewsicommandsine-commands-l-tutoral 413112736123, 722 AM Command Line Commands ~ CLI Tutorial
N.B.: You nave to be Careful while using the commands |'ll snow you.
This is because some commands can have a lasting negative or
positive effect on your Windows PC until you reset it.
In addition, some of these commands require you to open the
command prompt as an admin.
Cen ee
perery
Seas
fee
eet
ead
fern
eer open
Se Perens
carrey
eed
Poy
een
Windows Command Line
Commands
nitpssiwwwreecodecamp,orginewsicommandsine-commands-l-tvtoral 213112736123, 722 AM Command Line Commands ~ CLI Tutorial
an administrator:
driverquery — Lists All Installed Drivers
Itis important to have access to all drivers because they often cause
problems.
That's what this command does - it shows you even the drivers you
won't find in the device manager.
tps www reecodecamp.orginewsicommandsine-commands-ltverial!
sist2936123, 722 AM Command Line Commands ~ CLI Tutorial
chdir or cd —- Changes the Current Working
Directory to the Specified Directory
BH Command Prompt
systeminfo — Shows Your PC's Details
tps www reecodecamp.orginewsicommandsine-commands-ltverial! 413112736123, 722 AM Command Line Commands ~ CLI Tutorial
ax Cornimnana rromp.
eC
Sasa
eee Pesca cae
Seely etree
oooh rs
eos sc
eee semi PeVpezp Loe eee
5 Coane es
ra
HP EliteBc
oe
RO eee
set — Shows your PC’s Environment
Variables
tps www reecodecamp.orginewsicommandsine-commands-ltverial!
913112736123, 722 AM Command Line Commands ~ CLI Tutorial
prompt — Changes the Default Text Shown
before Entering Commands
By default, the command prompt shows the C drive path to your user
account.
You can use the prompt command to change that default text with the
syntax prompt prompt_name $6:
tps www reecodecamp.orginewsicommandsine-commands-ltverial!2736123, 722 AM Command Line Commands ~ CLI Tutorial
Donate
N.B: If you don't append $c to the command, you won't get the
greater than symbol in front of the text.
clip — Copies an Item to the Clipboard
For example, dir | clip copies all the content of the present
working directory to the clipboard.
IH Command Prompt
tps www reecodecamp.orginewsicommandsine-commands-ltverial!12736123, 722 AM Command Line Commands ~ CLI Tutorial
Donate
They are Associated With
BH Command Prompt
[cane ser
ACCDEFile.15
ACCDRFile.15
ACCDTFile.15
Pree la ates ee)
title - Changes the Command Prompt
Window Title Using the Format title
window-title-name
tps www reecodecamp.orginewsicommandsine-commands-ltverial! 813112736123, 722 AM
Command Line Commands ~ CLI Tutorial
Donate
fc - Compares Two Similar Files
If you are a programmer or writer and you want to quickly see what
differs between two files, you can enter this command and then the
full path to the two files. For example fe “file-1-path” “file-2-
path".
cipher — Wipes Free Space and Encrypts
Data
tps www reecodecamp.orginewsicommandsine-commands-ltverial! 913112736123, 722 AM Command Line Commands ~ CLI Tutorial
Donate
You can use the cipner command to wipe the arive clean and encrypt
such files.
BE Command Prompt
netstat -an — Shows Open Ports, their IP
Addresses and States
tps www reecodecamp.orginewsicommandsine-commands-ltverial! 1018112736123, 722 AM Command Line Commands ~ CLI Tutorial
you Know How Long it Takes to Transmit
Data and a Get Response
BH Command Prompt
color — Changes the Text Color of the
Command Prompt
Enter color attr to see the colors you can change to:
tps www reecodecamp.orginewsicommandsine-commands-ltverial! st2736123, 722 AM ‘Command Line Commands ~ CLI Tutorial
Donate
Entering color 2 changes the color of the terminal to green:
id Command Prompt - md
for /f “skip=9 tokens=1,2 delims %i in
(‘netsh wlan show profiles') do @echo %j |
findstr -i -v echo | netsh wlan show
tps www reecodecamp.orginewsicommandsine-commands-ltverial! 1218112736123, 722 AM Command Line Commands ~ CLI Tutorial
Donate
ipconfig - Shows Information about PC IP
Addresses and Connections
Bi Command Prompt
tps www reecodecamp.orginewsicommandsine-commands-ltverial! 1318112736123, 722 AM Command Line Commands ~ CLI Tutorial
troubleshoot issues with internet connections.
sfc — System File Checker
This command scans your computer for corrupt files and repairs them.
The extension of the command you can use to runascanis /scannow.
powercfg — Controls Configurable Power
Settings
You can use this command with its several extensions to show
information about the power state of your PC.
Youcan enter powercfg help to show those extensions.
tps www reecodecamp.orginewsicommandsine-commands-ltverial! 14312736123, 722AM Command Line Commands ~ CLI Tutorial
oa
Coe
Soe ee
Pee eas cee ees
For example, you can use powercfg /energy to generate a battery
health report.
Bil Administrator: CAWINDOWS\system32\cmd.exe
eestor
The powercfg /energy command will generate an HTML file
containing the report. You can find the HTML file in
C:\Windows\system32\energy-report.html.
tps www reecodecamp.orginewsicommandsine-commands-ltverial!
Donate
1613112736123, 722 AM Command Line Commands ~ CLI Tutorial
Donate
[BH Command Promot
del — Deletes a File
{BH Command Prompt
attrib +h +s +r folder_name — Hides a
Folder
tps www reecodecamp.orginewsicommandsine-commands-ltverial! 1613112736123, 722 AM Command Line Commands ~ CLI Tutorial
lo snow the Tolder again, execute the commana - attrib -h -s -r
folder_name .
{BH Command Prompt
start website-address — Logs on toa
Website from the Command Line
{BH sound
tps www reecodecamp.orginewsicommandsine-commands-ltverial!12736123, 722 AM Command Line Commands ~ CLI Tutorial
Sc 2014 mre
tree — Shows the Tree of the Current
Directory or Specified Drive
nitpssiwwwreecodecamp,orginewsicommandsine-commands-l-tvtoral12736123, 722 AM ‘Command Line Commands ~ CL Tutorial
Donate
ver — Shows the Version of the OS
tps www reecodecamp.orginewsicommandsine-commands-ltverial!12736123, 722 AM Command Line Commands ~ CLI Tutorial
Donate
ndows [Version 10.0.19044.
tasklist - Shows Open Programs
You can do the same thing you do with the task manager with this
command:
iitntor Command Prompt
The next command shows you how to close an open task.
tps www reecodecamp.orginewsicommandsine-commands-ltverial! 2018112736123, 722 AM Command Line Commands ~ CLI Tutorial
Donate
taskkill /IM "chrome.exe" /F :
date — Shows and Changes the Current
Date
{BH Command Prompt- date
tps www reecodecamp.orginewsicommandsine-commands-ltverial! 211312736123, 722 AM Command Line Commands ~ CLI Tutorial
Donate
BH Command Prompt - time
vol — Shows the Serial Number and Label
Info of the Current Drive
{BH Command Prompt
tps www reecodecamp.orginewsicommandsine-commands-ltverial! 2aist12736123, 722 AM Command Line Commands ~ CLI Tutorial
Donate
CTRL + C — Stops the Execution of a
Command
-help — Provides a Guide to other
Commands
For example, powercfg -help shows how to use the powercfg
command
tps www reecodecamp.orginewsicommandsine-commands-ltverial!2736123, 722AM Command Line Commands ~ CLI Tutorial
Donate
Se SER
rere ery
Pee aes
echo — Shows Custom Messages or
Messages from a Script or File
{BH Administrator. Command Prompt
You can also use the echo command to create a file with this syntax
echo file-content > filename.extension.
tps www reecodecamp.orginewsicommandsine-commands-ltverial! pais2736123, 722 AM Command Line Commands ~ CLI Tutorial
Donate
mkdir — Creates a Folder
IBY Command Prompt
rmdir — Deletes a Folder
tps www reecodecamp.orginewsicommandsine-commands-ltverial! 2si8112736123, 722 AM Command Line Commands ~ CLI Tutorial
Donate
N.B.: The folder must be empty for this command to work.
more — Shows More Information or the
Content of a File
[BH Command Prompt
tps www reecodecamp.orginewsicommandsine-commands-ltverial! 2618112736123, 722 AM Command Line Commands ~ CLI Tutorial
Donate
BH Command Prompt
ren — Renames a File with the Syntax ren
filename.extension new-name.extension
BH Command Prompt
cls - Clears the Command Line
tps www reecodecamp.orginewsicommandsine-commands-ltverial! aris12736123, 722 AM Command Line Commands ~ CLI Tutorial
exit — Closes the Command Line
shutdown — Shuts down, Restarts,
Hibernates, Sleeps the Computer
You can shut down, restart, hibernate, and sleep your PC from the
command line.
Enter shutdown in the command line so you can see the extensions
you can use to perform the actions. For example, shutdown /r will
restart your computer.
tps www reecodecamp.orginewsicommandsine-commands-ltverial!2736123, 7232 AM Command Line Commands ~ CLI Tutorial
[Donate |
Conclusion
This article showed you several “unknown-to-many” commands you
can use to get access to hidden functionalities on your Windows PC.
Again, you should be careful while working with these commands
because they can have a lasting effect on your OS.
If you find the commands helpful, share the article with your friends
and family.
In case you know another useful command | did not list, tell me about
iton Twitter. | will add it and mention you as the source.
Kolade Chris
Web developer and technical writer focusing on frontend technologies. | also
dabble in a lot of other technologies.
tps www reecodecamp.orginewsicommandsine-commands-ltverial! e18112736123, 722 AM Command Line Commands ~ CLI Tutorial
Learn to code for free. freeCodeCamp's open source curriculum has
helped more than 40,000 people get jobs as developers.
Get started
freeCodeCamp is a donor-supported tax-exempt 501(c)(3) charity organization (United States
Federal Tax Identification Number: 82-0779546)
‘Our mission: to help people learn to code for free. We accomplish this by creating thousands of
videos, articles, and interactive coding lessons - all freely available to the public.
Donations to freeCodeCamp go toward our education initiatives, and help pay for servers,
services, and staff.
You can make a tax-deductible donation here.
Trending Guides
What is Programming? What is a ROM?
Open-Closed Principle CSS Bold Text
‘Compare Strings in JS Git Reset Hard
Python str() Function Python Env Vars
Append to Python Dict Python Set vs List
time.sleep() in Python JavaScript Require
Python Requirements.txt Python Delete File
What is a String in JS? Python Sorted List
What's Ethical Hacking? Force Pull in GitHub
nitpssiwwwreecodecamp,orginewsicommandsine-commands-l-tvtoral 3003112118123, 732M Command Line Commands ~ CLI Tutorial
DNS Server Not Responding What's a Git Remote Branch?
Set a Static IP in Ubuntu Insert into JavaScript Array
Delete Key from Dict Python Filter an Array in JavaScript
Our Charity
About AlumniNetwork OpenSource Shop Support Sponsors Academic Honesty
Code of Conduct PrivacyPolicy TermsofService Copyright Policy
ntps:wwwfreecodecamp.orginewe/commanctine-commands-