Linux Files & Directories
ls -la | List all files with details |
cd /path | Change directory |
pwd | Print working directory |
mkdir dir | Create a directory |
rm -r dir | Remove file/directory recursively |
cp -r a b | Copy files/directories |
mv a b | Move or rename |
touch file | Create empty file / update timestamp |
find . -name "*.log" | Search for files by name |
Linux Viewing & Text
cat file | Show file contents |
less file | Scroll through a file |
head -n 20 file | First 20 lines |
tail -f file | Follow file as it grows |
grep "text" file | Search text in files |
wc -l file | Count lines |
nano file | Edit in a simple editor |
diff a b | Compare two files |
Linux System & Processes
top / htop | Live process monitor |
ps aux | List running processes |
kill -9 PID | Force-kill a process |
df -h | Disk space usage |
du -sh dir | Size of a directory |
free -h | Memory usage |
uname -a | Kernel / system info |
uptime | How long system has run |
Linux Permissions & Users
chmod 755 file | Change permissions |
chown user file | Change owner |
sudo cmd | Run as superuser |
whoami | Current user |
passwd | Change your password |
who | Who is logged in |
Linux Networking
ping host | Test connectivity |
ip a | Show IP addresses |
curl url | Fetch a URL |
wget url | Download a file |
ss -tulpn | List open ports/sockets |
ssh user@host | Connect to remote host |
scp file user@host:/path | Copy files over SSH |
Linux Packages & Services
apt install pkg | Install package (Debian/Ubuntu) |
apt update | Refresh package list |
dnf install pkg | Install package (Fedora/RHEL) |
systemctl status svc | Check a service |
systemctl restart svc | Restart a service |
journalctl -u svc | View service logs |
Windows Files & Directories
dir | List directory contents |
cd \path | Change directory |
cd | Show current directory |
mkdir dir | Create a directory |
rmdir /s dir | Remove directory + contents |
del file | Delete a file |
copy a b | Copy a file |
xcopy /s a b | Copy folders recursively |
move a b | Move or rename |
ren a b | Rename a file |
Windows Viewing & Text
type file | Show file contents |
more file | View file page by page |
find "text" file | Search text in a file |
findstr "regex" file | Search with patterns |
fc a b | Compare two files |
notepad file | Open in Notepad |
Windows System & Processes
tasklist | List running processes |
taskkill /PID 123 /F | Force-kill a process |
systeminfo | Detailed system info |
ver | Windows version |
hostname | Computer name |
shutdown /r /t 0 | Restart now |
sfc /scannow | Repair system files |
Windows Networking
ipconfig /all | Show network config |
ipconfig /flushdns | Clear DNS cache |
ping host | Test connectivity |
tracert host | Trace network route |
nslookup domain | DNS lookup |
netstat -ano | Connections + owning PID |
net use | Map/list network drives |
Windows Users & Admin
whoami | Current user |
net user | List / manage user accounts |
net localgroup administrators | List admins |
gpupdate /force | Refresh group policy |
runas /user:admin cmd | Run as another user |
Windows PowerShell Basics
Get-ChildItem | List items (like ls) |
Get-Content file | Show file contents |
Get-Process | List processes |
Stop-Process -Id 123 | Kill a process |
Get-Service | List services |
Test-Connection host | Ping equivalent |
Get-Help cmd | Help for a command |
No commands match your search.