Windows 11’s built-in terminal (Command Prompt or PowerShell) lets you perform tasks faster than menus—from scanning files to automating scripts. You’ll need only a working PC with Windows 11 installed; no extra software is required. Below is a practical guide to the most useful commands, common pitfalls, and fixes for glitches.
What You'll Need
- A PC running Windows 11 (labeled "Windows 11" in the operating system version).
- Administrator privileges for advanced tasks (e.g., installing software).
- A stable internet connection for updates (if needed).
Step-by-Step
-
Open the Terminal:
Press
Win + X, then selectTerminal (Admin)(for elevated access) orWindows Terminal(recommended for modern workflows). Windows 11 also includes the pre-installed Command Prompt underStart > All Apps > Windows Terminal. Labels may vary by version or device. -
Switch to PowerShell (for scripting):
In the Terminal, type
powershelland pressEnterto run PowerShell instead of Command Prompt. This is the preferred environment for advanced automation (e.g., file management, system checks). -
Navigate to a folder:
Use
cdto change directories. For example:cd Documentsmoves to the Documents folder. To return to the root directory, runcd \. For a relative path (e.g., "parent folder of Desktop"), usecd ... -
List files and folders:
Run
dir(Command Prompt) orGet-ChildItem(PowerShell) to see contents. Filter results: Add a suffix to narrow output (e.g.,dir *.txtlists all .txt files). -
Create and delete files:
type newfile.txtcreates an empty text file. Append content withecho "Hello" >> newfile.txt. Delete a file withdel newfile.txt. -
Rename/move files:
Use
ren oldname.txt newname.txt(rename) ormove file.txt C:\Backup(move). -
Check disk space:
Run
wmic logicaldisk get size,freespaceto see available space on drives. -
Update Windows manually:
PowerShell’s
winget upgrade --allinstalls all available updates. For critical patches, usewinget upgrade --id Microsoft.Windows.InsiderPreview(if Insider builds are enabled). -
Find installed software:
Use
Get-Package -AllVersions | Select Name, Versionin PowerShell to list installed apps. -
Restart services:
Stop/start services like
Task Manager(e.g.,Restart-Service -Name 'TaskScheduler'in PowerShell). -
Backup files:
Use
robocopy source destination /E /ZBto copy all subfolders (including hidden files) with error handling. Replacesource(e.g.,C:\Users\YourName\Documents) anddestination(e.g.,X:\Backup).
Common Mistakes
- Forgetting to run commands as Admin: Some actions (e.g., updating drivers) require elevated permissions. Always launch the Terminal as Administrator.
-
Misusing wildcards: In
dir *.*,*.*lists all files. Use*alone for a wildcard (e.g.,dir *.docx). -
Overwriting files: Use
move /Y file.txt C:\Backupto skip confirmation prompts. For critical files, double-check paths first. -
Ignoring case sensitivity: In some paths,
Folder≠folder. Use full paths (e.g.,C:\Program Files) to avoid errors.
Tips
-
Shortcuts: Press
Ctrl + Shift + Vto paste from Clipboard. Use!!to repeat the last command. -
Aliases: Create shortcuts like
alias ls="dir"to replacedirwith a custom command. - PowerShell for automation: Save scripts as .ps1 files and run them repeatedly (e.g., to back up daily).
-
Check command help: Type
help dir(Command Prompt) orGet-Help dir(PowerShell) for details.
Troubleshooting
-
Terminal won’t open:
Restart your PC. If issues persist, delete the Terminal app data:
cd %LocalAppData%\Microsoft\WindowsApps, deleteTerminal.exe, then reinstall viaMicrosoft Store. -
Commands return errors:
Check for typos. Use
type nul \| moreto test if redirection works. For missing modules in PowerShell, runImport-Module -Name.-Force -
Slow performance:
Close background apps. Run
tasklist \| find "chrome"to see active processes; terminate them viataskkill /PID. -
Permission denied:
Run the Terminal as Admin or add
--forceto commands (e.g.,winget upgrade --all --force).
Frequently Asked Questions
How do I switch between Command Prompt and PowerShell?
Open the Terminal, type cmd to launch Command Prompt or powershell to switch to PowerShell.
Why won’t my commands recognize the folder I’m in?
Use absolute paths (e.g., C:\Users\YourName\Documents) instead of relative paths (.\file.txt). Run cd to list current directory first.
How can I back up my entire system?
Use Windows Backup (via Settings > System > Backup & Restore) or create a .img file with robocopy C:\ (or drive) D:\Backup /E /MIR, then boot from a USB drive.
What’s the difference between Command Prompt and PowerShell?
Command Prompt uses dir and del; PowerShell uses Get-ChildItem and Remove-Item. PowerShell supports scripting and advanced automation.
How do I check my Windows version?
Run systeminfo | findstr "System Type" in Command Prompt for details like CPU, OS architecture, and edition.
Can I use terminal commands to fix a corrupted file?
Restore from backup if possible. Use tools like chkdsk C: /f (Command Prompt) to fix disk errors, but avoid manual fixes for files without backups.
For advanced issues, consult Microsoft’s [support documentation](https://support.microsoft.com).