Home/Engineer/Linux / Shell/100 Essential Linux Commands…
Linux / ShellBeginnerubuntucentosdebianmacoslinuxshellbash

100 Essential Linux Commands

A category-by-category roundup of Linux commands you use every day on the job—from file operations to process management.

Contents
  1. File and Directory Operations
  2. Text Processing
  3. Process Management
  4. Permissions
  5. Disk / Memory

File and Directory Operations

ls — List files

Bash
ls -lah          # List including hidden files, human-readable sizes
ls -lt           # Sort by modification time, newest first

cp / mv / rm

Bash
cp -r src/ dest/          # Recursively copy a directory
mv old.txt new.txt        # Rename or move
rm -rf dir/               # Force-delete a directory (use with caution)

find — Search for files

Bash
find /var/log -name "*.log" -mtime -7   # .log files modified within the last 7 days
find . -type f -size +100M              # Files larger than 100MB
find . -name "*.sh" -exec chmod +x {} \;

Text Processing

grep

Bash
grep -rn "ERROR" /var/log/   # Recursive search with line numbers
grep -v "DEBUG" app.log      # Exclude DEBUG
grep -E "error|warn" app.log # Regex OR

awk

Bash
awk '{print $1, $3}' access.log          # Print 1st and 3rd columns
awk -F: '{print $1}' /etc/passwd         # Use : as the field separator
awk 'NR>5{print}' file.txt               # Print from line 6 onward

sed

Bash
sed -i 's/old/new/g' file.txt    # In-place substitution
sed -n '10,20p' file.txt         # Print lines 10–20 only
sed '/^#/d' config.conf          # Delete comment lines

Process Management

Bash
ps aux | grep nginx          # Check processes
top -c                       # Live CPU/memory view (show full command)
htop                         # Interactive viewer
kill -9 PID                  # Force kill
pkill -f "python app.py"     # Kill by name
nohup ./script.sh &          # Run in background; keep running after the terminal closes

Permissions

Bash
chmod 755 script.sh          # rwxr-xr-x
chown user:group file.txt    # Change owner
umask 022                    # Default permission mask
sudo -u www-data bash        # Run a shell as another user

Disk / Memory

Bash
df -h                        # Disk usage
du -sh /var/*                # Size by directory
free -h                      # Memory status
iostat -xz 1                 # I/O statistics (1-second interval)
#linux#shell#bash
Editorial note

AI tools may assist drafting. Check the evidence in each guide for whether commands were run and which environment was used. Confirm the current docs for your version before applying instructions, and email us about errors. email us

Topic-related official docs (auto-linked · not per-claim sources)Linux man pages ↗

Questions & answers

Ask a question about this guide. We'll review and reply.