Wednesday, April 30, 2025

list of commonly used Command Prompt (CMD) commands in Windows

 Here’s a list of commonly used Command Prompt (CMD) commands in Windows, categorized for better understanding:


Basic Navigation & File Management

CommandDescription
dirList files and folders in the current directory
cd or chdirChange directory (e.g., cd C:\Folder)
cd ..Move up one directory level
cd \Go to the root directory
mkdir or mdCreate a new folder (e.g., mkdir NewFolder)
rmdir or rdRemove a folder (e.g., rmdir OldFolder)
delDelete a file (e.g., del file.txt)
copyCopy files (e.g., copy file.txt C:\Backup)
moveMove files (e.g., move file.txt C:\NewLocation)
ren or renameRename a file (e.g., ren old.txt new.txt)
typeDisplay file contents (e.g., type file.txt)
treeDisplay folder structure as a tree

System Information & Management

CommandDescription
systeminfoDisplay detailed system information
hostnameShow the computer name
verDisplay Windows version
tasklistList all running processes
taskkillTerminate a process (e.g., taskkill /IM notepad.exe /F)
shutdownShutdown or restart PC (e.g., shutdown /s /t 0)
ipconfigDisplay network configuration (use ipconfig /all for details)
pingTest network connectivity (e.g., ping google.com)
netstatShow active network connections
sfc /scannowScan and repair system files
chkdskCheck disk for errors (e.g., chkdsk C: /f)

User & Permission Management

CommandDescription
whoamiDisplay current username
net userList all user accounts
net user [username]View details of a specific user
net localgroupList all local groups
runasRun a program as a different user

Network & Connectivity

CommandDescription
tracertTrace network route (e.g., tracert google.com)
nslookupQuery DNS records (e.g., nslookup google.com)
arp -aDisplay ARP (Address Resolution Protocol) table
netshConfigure network interfaces (advanced)

Miscellaneous Useful Commands

CommandDescription
clsClear the CMD screen
exitClose Command Prompt
helpList available commands (or use command /? for help on a specific command)
colorChange text/background color (e.g., color 0A for black bg & green text)
timeDisplay/set system time
dateDisplay/set system date
echoDisplay a message (e.g., echo Hello World)
startOpen a file/program (e.g., start notepad.exe)

Advanced & Admin Commands

CommandDescription
diskpartManage disks/partitions (advanced)
bcdeditModify Windows boot configuration
gpupdate /forceForce update Group Policy settings
wmicWindows 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