---
title: "Linux Commands Cheatsheet | FindUtils"
description: "Essential Linux commands for file management, processes, networking, and system administration"
url: https://findutils.com/cheatsheets/linux-commands/
---

# Linux Commands Cheatsheet

Essential Linux commands for file management, processes, networking, and system administration 61 commands in 8 sections, filed under [Linux & Terminal](https://findutils.com/cheatsheets/linux/).

## File & Directory Operations

- `ls -la`: List all files with details
- `cd <dir>`: Change directory
- `pwd`: Print working directory
- `mkdir -p <dir/sub>`: Create nested directories
- `rm -rf <dir>`: Remove directory recursively (use with caution)
- `cp -r <src> <dest>`: Copy directory recursively
- `mv <src> <dest>`: Move or rename file/directory
- `touch <file>`: Create empty file or update timestamp
- `ln -s <target> <link>`: Create symbolic link
- `find . -name "*.log"`: Find files by name pattern

## File Content

- `cat <file>`: Display file contents
- `less <file>`: View file with pagination
- `head -n 20 <file>`: Show first 20 lines
- `tail -f <file>`: Follow file updates in real-time
- `wc -l <file>`: Count lines in file
- `sort <file>`: Sort file lines
- `uniq`: Remove duplicate adjacent lines
- `diff <file1> <file2>`: Compare two files

## Search & Filter

- `grep -r "pattern" .`: Search recursively in files
- `grep -i "pattern" <file>`: Case-insensitive search
- `grep -n "pattern" <file>`: Search and show line numbers
- `grep -v "pattern" <file>`: Show lines NOT matching
- `find . -type f -mtime -7`: Files modified in last 7 days
- `find . -size +100M`: Files larger than 100MB
- `locate <filename>`: Fast file search (uses index)
- `which <command>`: Show path of command binary

## Permissions & Ownership

- `chmod 755 <file>`: Set rwxr-xr-x permissions
- `chmod +x <file>`: Make file executable
- `chmod -R 644 <dir>`: Set permissions recursively
- `chown user:group <file>`: Change file owner and group
- `chown -R user:group <dir>`: Change ownership recursively
- `umask 022`: Set default file creation permissions

## Process Management

- `ps aux`: List all running processes
- `ps aux | grep <name>`: Find process by name
- `top`: Real-time process monitor
- `htop`: Interactive process viewer
- `kill <PID>`: Send SIGTERM to process
- `kill -9 <PID>`: Force kill a process
- `killall <name>`: Kill all processes by name
- `nohup <cmd> &`: Run command immune to hangups
- `bg / fg`: Move job to background / foreground

## Networking

- `curl -X GET <url>`: Make HTTP request
- `wget <url>`: Download file from URL
- `ping <host>`: Test network connectivity
- `netstat -tulpn`: Show listening ports
- `ss -tulpn`: Show listening ports (modern)
- `ip addr show`: Show network interfaces
- `dig <domain>`: DNS lookup
- `ssh user@host`: SSH into remote machine
- `scp <file> user@host:<path>`: Copy file to remote machine

## Disk & System Info

- `df -h`: Show disk space usage
- `du -sh <dir>`: Show directory size
- `free -h`: Show memory usage
- `uname -a`: Show system information
- `uptime`: Show system uptime
- `whoami`: Show current user
- `hostname`: Show system hostname

## Sources

- `https://www.gnu.org/software/coreutils/manual/`: GNU Coreutils: file, text, ownership, and permission commands.
- `https://www.gnu.org/software/bash/manual/`: GNU Bash: shell builtins and job control.
- `https://curl.se/docs/manpage.html`: curl: HTTP request options and their limits.
- `https://man.openbsd.org/ssh`: OpenSSH: remote connection options.

## Related

- Cheatsheet: [Bash Scripting](https://findutils.com/cheatsheets/bash-scripting/)
- Cheatsheet: [Vim Editor](https://findutils.com/cheatsheets/vim-editor/)
- Cheatsheet: [SSH Commands](https://findutils.com/cheatsheets/ssh-commands/)
- Guide: [Chmod Calculator: Read Linux File Permission Values](https://findutils.com/guides/chmod-calculator-guide/)
- Guide: [Find and xargs Cheatsheet: Commands and Web Tool Alternatives](https://findutils.com/guides/findutils-cheatsheet-command-line-to-web-tools/)
