Here’s a list of commonly used Command Prompt (CMD) commands in Windows, categorized for better understanding:
Basic Navigation & File Management
| Command | Description |
|---|
dir | List files and folders in the current directory |
cd or chdir | Change directory (e.g., cd C:\Folder) |
cd .. | Move up one directory level |
cd \ | Go to the root directory |
mkdir or md | Create a new folder (e.g., mkdir NewFolder) |
rmdir or rd | Remove a folder (e.g., rmdir OldFolder) |
del | Delete a file (e.g., del file.txt) |
copy | Copy files (e.g., copy file.txt C:\Backup) |
move | Move files (e.g., move file.txt C:\NewLocation) |
ren or rename | Rename a file (e.g., ren old.txt new.txt) |
type | Display file contents (e.g., type file.txt) |
tree | Display folder structure as a tree |
System Information & Management
| Command | Description |
|---|
systeminfo | Display detailed system information |
hostname | Show the computer name |
ver | Display Windows version |
tasklist | List all running processes |
taskkill | Terminate a process (e.g., taskkill /IM notepad.exe /F) |
shutdown | Shutdown or restart PC (e.g., shutdown /s /t 0) |
ipconfig | Display network configuration (use ipconfig /all for details) |
ping | Test network connectivity (e.g., ping google.com) |
netstat | Show active network connections |
sfc /scannow | Scan and repair system files |
chkdsk | Check disk for errors (e.g., chkdsk C: /f) |
User & Permission Management
| Command | Description |
|---|
whoami | Display current username |
net user | List all user accounts |
net user [username] | View details of a specific user |
net localgroup | List all local groups |
runas | Run a program as a different user |
Network & Connectivity
| Command | Description |
|---|
tracert | Trace network route (e.g., tracert google.com) |
nslookup | Query DNS records (e.g., nslookup google.com) |
arp -a | Display ARP (Address Resolution Protocol) table |
netsh | Configure network interfaces (advanced) |
Miscellaneous Useful Commands
| Command | Description |
|---|
cls | Clear the CMD screen |
exit | Close Command Prompt |
help | List available commands (or use command /? for help on a specific command) |
color | Change text/background color (e.g., color 0A for black bg & green text) |
time | Display/set system time |
date | Display/set system date |
echo | Display a message (e.g., echo Hello World) |
start | Open a file/program (e.g., start notepad.exe) |
Advanced & Admin Commands
| Command | Description |
|---|
diskpart | Manage disks/partitions (advanced) |
bcdedit | Modify Windows boot configuration |
gpupdate /force | Force update Group Policy settings |
wmic | Windows Management Instrumentation (advanced system queries) |
Shortcuts & Tips
Press Tab to auto-complete file/folder names.
Use ↑ and ↓ arrow keys to cycle through command history.
Redirect output with > (e.g., dir > files.txt saves directory listing to a file).
Run CMD as Administrator for commands requiring elevated privileges.
No comments:
Post a Comment