Every Command in Command Prompt: A How-To Guide
In this article
There is no single list of "every" Command Prompt command because Windows ships with dozens of built-in commands and hundreds of utilities, and the set changes between Windows versions. What you can do is learn the commands that matter, find the full official list on your own PC, and run each one safely. This guide shows you how to open Command Prompt, discover commands, use the most useful ones, and avoid the mistakes that cause damage. No special tools are needed beyond a Windows PC and administrator access for some commands.
What You'll Need
- A Windows 10 or Windows 11 PC (steps are for Windows; Mac and Linux use different shells).
- An account with administrator rights for commands that change system settings.
- A little caution: some commands delete files or change boot settings permanently.
Step-by-Step
- Open Command Prompt. Press the Windows key, type
cmd, and press Enter. For administrator rights, right-click "Command Prompt" in the results and choose "Run as administrator". You can also press Windows+R, typecmd, and press Enter. Menu labels can differ slightly by Windows version and region. - See the full command list. Type
helpand press Enter to see the built-in commands. For help on one command, type the command followed by/?, for exampledir /?. This is the authoritative list for your exact Windows build. - Learn navigation first.
dirlists files and folders in the current directory.cdchanges directory (for examplecd Documents).cd ..goes up one level.clsclears the screen. These four commands let you move around without guessing. - Manage files and folders.
mkdircreates a folder,rmdirremoves an empty folder,copycopies files,movemoves them, anddeldeletes files.renrenames a file. Test these in a temporary folder before using them on important data. - Check and repair your network.
ipconfigshows your IP address and network settings.ipconfig /flushdnsclears the DNS cache.pingtests whether a host is reachable (for exampleping example.com).tracertshows the path to a host.netstatlists active connections. These are safe to run and useful for diagnosing Wi-Fi and internet problems. - Inspect and manage the system.
systeminfodisplays OS version, memory, and installed updates.tasklistshows running processes;taskkill /PIDfollowed by a process ID ends one.sfc /scannowchecks and repairs Windows system files and needs administrator rights.chkdskchecks a disk; run it without options first to scan, and note that repair options can take a long time. - Use shutdown and restart commands.
shutdown /s /t 0shuts down immediately,shutdown /r /t 0restarts, andshutdown /acancels a pending shutdown. The/tvalue is seconds of delay. - Get help for any command. Append
/?to almost any command to see its syntax and switches. For example,shutdown /?lists every option. This is how you learn commands without memorizing them. - Use Tab completion and history. Press Tab to auto-complete file and folder names as you type. Press the Up arrow to recall previous commands. Both reduce typos, which matter most with delete commands.
- Close the window. Type
exitand press Enter, or click the X. Commands stop when the window closes.
Common Mistakes
- Running
delorrmdirin the wrong folder. Always rundirfirst to confirm where you are. - Typing commands without administrator rights and getting "Access denied". Reopen Command Prompt as administrator.
- Using
chkdsk /forsfc /scannowcasually. These change system files and can take a long time; run them only when you suspect a problem. - Forgetting that
shutdown /scloses everything without saving. Save your work before using shutdown commands. - Assuming Mac or Linux commands work.
ls,grep, andsudoare not Command Prompt commands.
Tips
- Use
help commandorcommand /?before running anything unfamiliar. - Work in a test folder when learning file commands.
- Copy long paths from File Explorer instead of typing them.
- Keep a note of commands you use often; Command Prompt does not save a favorites list.
- If a command seems to hang, press Ctrl+C to stop it.
Troubleshooting
- "'command' is not recognized". Check spelling, or the command may not exist in your Windows version. Run
helpto see what is available. - "Access denied". Reopen Command Prompt as administrator.
- Command runs but nothing happens. Some commands (like
ping) wait for a response; press Ctrl+C to stop. Others need a target, such as a file name or IP address. - Network commands show wrong results. Run
ipconfig /releasethenipconfig /renewto refresh your IP address, then test again. - System file checker finds errors it cannot fix. Note the message and check Windows Update; some repairs require a restart or installation media.
Frequently Asked Questions
How do I see every command available?
Type help at the prompt for built-in commands. For a specific command, type command /?. The list depends on your Windows version.
Are Command Prompt commands dangerous?
Some are. del, rmdir, format, and chkdsk /f can delete data or change system files. Read the help text before running them.
Can I use Command Prompt on a Mac?
No. Mac uses Terminal with Unix commands. The commands in this guide are for Windows.
Why does a command say "Access denied"?
It needs administrator rights. Close the window, right-click Command Prompt, and choose "Run as administrator".
How do I stop a command that is running?
Press Ctrl+C. For commands that ignore Ctrl+C, close the window.
Do I need to memorize commands?
No. Use help and /? to look up syntax, and Tab completion to avoid typing full paths.