Skip to main content

Linux & Bash

Essential terminal commands for Linux/macOS

DevOps

Navigation

pwd

Print working directory

cd <dir>

Change directory

cd ..

Go up one level

cd ~

Go to home directory

ls

List files

ls -la

List all with details

File Operations

cp <src> <dest>

Copy file

cp -r <src> <dest>

Copy directory

mv <src> <dest>

Move or rename

rm <file>

Remove file

rm -rf <dir>

Remove directory

mkdir <dir>

Create directory

touch <file>

Create empty file

File Content

cat <file>

Display file content

head -n 10 <file>

First 10 lines

tail -n 10 <file>

Last 10 lines

tail -f <file>

Follow file updates

less <file>

View with pagination

grep 'pattern' <file>

Search in file

Permissions

chmod 755 <file>

Set permissions

chmod +x <file>

Make executable

chown user:group <file>

Change owner

sudo <cmd>

Run as superuser

Process Management

ps aux

List all processes

top

Monitor processes

kill <pid>

Kill process by ID

killall <name>

Kill by name

bg

Run job in background

fg

Bring to foreground

nohup <cmd> &

Run immune to hangups

Network

curl <url>

Make HTTP request

wget <url>

Download file

ping <host>

Test connectivity

netstat -tulpn

List open ports

ssh user@host

SSH connection

scp <file> user@host:

Secure copy

Privacy-First Developer Toolkits - 35+ Browser-Based Tools