Linux Terminal Cheatsheet
Essential Linux commands for file operations, permissions, processes, and system administration.
| Command | Description | Syntax | Example | Category |
|---|---|---|---|---|
| pwd | Print working directory | pwd | pwd | Navigation |
| cd | Change directory | cd [path] | cd /home/user/projects | Navigation |
| ls | List directory contents | ls [options] | ls -la /home | Navigation |
| mkdir | Create directory | mkdir [options] path | mkdir -p /path/to/dir | Files |
| cp | Copy files/directories | cp [options] source dest | cp -r src/ dest/ | Files |
| mv | Move/rename files | mv source dest | mv file.txt /home/user/ | Files |
| rm | Remove files/directories | rm [options] path | rm -rf /path/to/dir | Files |
| touch | Create empty file | touch filename | touch new_file.txt | Files |
| cat | View file contents | cat filename | cat /etc/hostname | Files |
| less | View file with pagination | less filename | less /var/log/syslog | Files |
| head | View first lines of file | head -n count filename | head -n 20 file.txt | Files |
| tail | View last lines of file | tail -n count filename | tail -f /var/log/app.log | Files |
| chmod | Change file permissions | chmod mode file | chmod 755 script.sh | Permissions |
| chown | Change file owner | chown user:group file | chown user:group /home/user/file | Permissions |
| sudo | Execute with super user privileges | sudo command | sudo apt-get install package | Permissions |
| ps | List running processes | ps [options] | ps aux | Processes |
| kill | Terminate process | kill -signal pid | kill -9 1234 | Processes |
| top | Monitor system processes | top | top | Processes |
| find | Search for files | find path -name pattern | find /home -name "*.js" | Search |
| grep | Search file contents | grep [options] pattern file | grep -r "function" src/ | Search |
| df | Show disk space usage | df [options] | df -h | System |
| du | Show directory size | du [options] path | du -sh /home/user | System |
| whoami | Show current user | whoami | whoami | System |
| uname | Show system information | uname [options] | uname -a | System |