Command Reference
Linux Terminal Commands
Complete Linux Terminal command reference with syntax, examples, parameters and safer alternatives — free and searchable.
All categories
Navigation
Files & Folders
Search
Processes
Networking
System
Permissions
Packages
Git
Docker
Environment
62 commands
- BASHNavigation
Print working directory
pwd - BASHNavigation
Change directory
cd {path} - BASHFiles & Folders
List files
ls -lah {path} - BASHFiles & Folders
Create folder
mkdir -p {name} - BASHFiles & Folders
Copy files
cp -r {src} {dst} - BASHFiles & Folders
Move files
mv {src} {dst} - BASHFiles & Folders
Delete safely
rm -i {path} - BASHSearch
Search text in files
grep -rni "{text}" {path} - BASHProcesses
List processes
ps aux | grep {name} - BASHProcesses
Kill process
kill {pid} - BASHNetworking
Show IP / network config
ip addr show - BASHNetworking
Test connectivity
ping -c 4 {host} - BASHSystem
Disk usage
df -h - BASHPermissions
View permissions
ls -ld {path} - BASHPermissions
Change permissions
chmod {mode} {path} - BASHEnvironment
Show environment variable
echo ${name} - BASHPackages
Install package
sudo apt install {name} - BASHGit
Clone repository
git clone {url} - BASHGit
Check status
git status - BASHGit
Commit changes
git commit -am "{msg}" - BASHDocker
List containers
docker ps -a - BASHDocker
Run container
docker run -d --name {name} {image} - BASHDocker
Remove container
docker rm {name} - BASHSystem
Clear screen
clear - BASHFiles & Folders
Read file contents
cat {path} - BASHFiles & Folders
Follow log file
tail -f {path} - BASHSearch
Find files by name
find {path} -name "{pattern}" - BASHNetworking
Download a file
curl -L -o {dst} {url} - BASHNetworking
List listening ports
ss -tulpn - BASHNetworking
DNS lookup
dig {host} +short - BASHNetworking
Trace network route
traceroute {host} - BASHSystem
System information
uname -a - BASHProcesses
CPU & memory usage
top - BASHPermissions
Run as administrator
sudo {cmd} - BASHPermissions
Change file owner
sudo chown {user}:{group} {path} - BASHSystem
Manage a service
sudo systemctl restart {name} - BASHSystem
View system logs
journalctl -u {unit} -f - BASHFiles & Folders
Compress to archive
tar -czf {dst} {src} - BASHNetworking
Connect to remote host
ssh {user}@{host} - BASHNetworking
Copy file over SSH
scp {src} {user}@{host}:{dst} - BASHGit
Pull latest
git pull --rebase - BASHGit
Push to remote
git push {remote} {branch} - BASHGit
Create & switch branch
git switch -c {name} - BASHGit
View history
git log --oneline --graph --decorate -20 - BASHGit
View pending changes
git diff - BASHGit
Discard local changes
git restore {path} - BASHDocker
Container logs
docker logs -f {name} - BASHDocker
Shell into container
docker exec -it {name} {sh} - BASHDocker
Build image
docker build -t {tag} . - BASHPackages
Update packages
sudo apt update && sudo apt upgrade - BASHSystem
Print text
echo "{text}" - BASHSystem
Command history
history - BASHFiles & Folders
Rename a file
mv {old} {new} - BASHFiles & Folders
Create empty file
touch {name} - BASHFiles & Folders
Show first lines of file
head -n 20 {path} - BASHSystem
Restart the computer
sudo systemctl reboot - BASHSystem
Show current user
whoami - BASHSystem
Show memory usage
free -h - BASHSystem
Show folder size
du -sh {path} - BASHFiles & Folders
Extract an archive
tar -xzf {src} - BASHEnvironment
Locate a command
which {name} - BASHEnvironment
Set environment variable
export {name}={value}