Windows & Linux Commands Cheat Sheet (150
Commands)
Windows (75 Commands)
Command Description
help Show all commands
cls Clear screen
echo [text] Print message
exit Close CMD
ver Show Windows version
title [text] Set CMD title
color [code] Change text/background color
prompt [text] Change CMD prompt
mode Change display settings
fc [file1] [file2] Compare files
dir List files and directories
cd [path] Change directory
cd .. Go up one directory
mkdir [folder] Create folder
rmdir [folder] Remove folder
del [file] Delete file
copy [src] [dest] Copy file
move [src] [dest] Move file
ren [old] [new] Rename file/folder
attrib [file] Change file attributes
tree Show directory tree
path Display/set PATH variable
type [file] Show file content
print [file] Print file
comp [file1] [file2] Binary comparison
systeminfo Show full system info
hostname Show computer hostname
whoami Display logged-in user
set Show environment variables
echo %PATH% Display PATH variable
driverquery List installed drivers
tasklist Show running processes
taskkill /IM [proc] /F Kill process by name
wmic cpu get name Display CPU info
wmic memorychip get capacity Show RAM details
chkdsk [drive:] Check disk errors
diskpart Partition tool
label [drive:] Change drive label
vol Show volume info
setx VAR VALUE Set environment variable
ipconfig Show network info
ipconfig /all Detailed network info
ipconfig /release Release IP address
ipconfig /renew Renew IP address
ping [host] Ping a host
tracert [host] Trace route
netstat -an Show network connections
nslookup [domain] DNS lookup
arp -a Show ARP cache
getmac Show MAC address
net view View network computers
net use Map network drive
net share Share folders
netsh wlan show profiles Show Wi-Fi profiles
netsh wlan export profile name=[SSID] Export Wi-Fi password
net user List users
net user [name] [pass] /add Add user
net user [name] /delete Delete user
net localgroup administrators [name] /add Add admin user
gpresult /R Show group policies
runas /user:[domain\user] cmd Run as another user
cipher /w:[drive] Wipe deleted data
sfc /scannow System file checker
DISM /Online /Cleanup-Image /RestoreHealth Repair system image
reg query Query registry
reg add Add registry key
reg delete Delete registry key
shutdown /s /f /t 0 Shutdown now
shutdown /r /t 0 Restart now
shutdown /l Log off
powercfg /a Show power states
powercfg /energy Energy report
powercfg /batteryreport Battery health report
[Link] Task Scheduler
eventvwr Event Viewer
Linux (75 Commands)
Command Description
clear Clear terminal screen
pwd Show working directory
date Show system date/time
cal Show calendar
uptime System uptime
uname -a System/kernel info
whoami Current logged user
who List logged-in users
man [cmd] Command manual
history Show command history
ls List files
ls -l Long list format
ls -a Show hidden files
cd [dir] Change directory
cd .. Go to parent dir
mkdir [dir] Create directory
rmdir [dir] Remove directory
rm -r [dir] Remove directory & files
tree Display directory tree
find /path -name [file] Search file
touch [file] Create file
cat [file] Show file content
less [file] View file page by page
head -n 10 [file] Show first 10 lines
tail -n 10 [file] Show last 10 lines
cp [src] [dest] Copy file
mv [src] [dest] Move or rename file
rm [file] Delete file
nano [file] Edit file with Nano
vim [file] Edit file with Vim
id Show user info
groups List groups
adduser [name] Add user
passwd [name] Change password
su [user] Switch user
sudo [cmd] Run as root
w Show logged-in users
chmod 755 [file] Change permissions
chown user:group [file] Change ownership
ps aux Show processes
top Process monitor
htop Interactive monitor
kill -9 [PID] Kill process
jobs Show background jobs
fg %1 Resume job in foreground
bg %1 Run job in background
nice -n [num] [cmd] Run with priority
renice [PID] [value] Change process priority
df -h Disk usage
du -sh [dir] Folder size
lsblk List block devices
mount [dev] [dir] Mount device
umount [dev] Unmount device
fsck [disk] Check filesystem
file [name] File type info
stat [file] File details
ln -s [src] [dest] Create symlink
tar -czf [Link] [dir] Create archive
ifconfig / ip a Show IP address
ping [host] Test connection
traceroute [host] Trace route
curl [url] Fetch content
wget [url] Download file
scp [file] user@host:/path Copy via SSH
ssh user@host Remote login
ftp [host] FTP connection
netstat -tulnp Show open ports
ss -tulnp Alternative to netstat
apt update Update repositories
apt upgrade Upgrade packages
apt install [pkg] Install package
apt remove [pkg] Remove package
reboot Restart system
shutdown now Shutdown system