Back to Resources
Linux Terminal Reference
A quick reference list of the most used commands for navigating and managing Linux servers from the terminal.
| Command | Description |
|---|---|
| ls | Lists the content of the current directory. Ex: ls -la |
| cd [dir] | Changes the current directory to [dir]. Ex: cd /var/www/html |
| pwd | Displays the full path of the current directory. Ex: pwd |
| mkdir [name] | Creates a new directory. Ex: mkdir new_folder |
| rm [file] | Deletes files or directories (use with caution). Ex: rm -r old_folder |
| cp [source] [destination] | Copies files or directories. Ex: cp file.txt backup.txt |
| mv [source] [destination] | Moves or renames files/directories. Ex: mv file.txt documents/ |
| grep '[text]' [file] | Searches for a text pattern within files. Ex: grep 'error' server.log |
| cat [file] | Displays the entire content of a file in the terminal. Ex: cat notes.txt |
| tail -f [file] | Displays the last lines of a file in real-time (useful for logs). Ex: tail -f access.log |
| chmod [permissions] [file] | Changes read/write/execute permissions. Ex: chmod 755 script.sh |
| chown [user]:[group] [file] | Changes the owner and group of a file/directory. Ex: chown www-data:www-data index.php |
| sudo [command] | Executes a command with superuser (root) privileges. Ex: sudo apt update |
| top | Displays running processes and resource usage in real-time. Ex: top |
| ssh [user]@[host] | Securely connects to a remote server. Ex: ssh root@192.168.1.10 |