| COMMAND | DESCRIPTION | EXAMPLE |
| pwd | Show current directory | pwd → /home/user/projects |
| ls | List files and folders in current directory | ls -la → lists all files with details |
| cd [directory] | Change directory | cd /var/log |
| mkdir [dir] | Create a new directory | mkdir myfolder |
| rmdir [dir] | Remove an empty directory | rmdir myfolder |
| rm [file] | Remove a file | rm oldfile.txt |
| cp [src] [dest] | Copy files o directories | cp file.txt backup/file.txt |
| touch [file] | Create an empty file | touch newfile.txt |
| cat [file] | show file content | cat /etc/passwd |
| head [file] | Show first 10 lines of a file | head -n 5 access.log |
| tail [file] | Show last 10 lines of a file | tail -f /var/log/syslog (follow live) |
| nano [file], vim [file] | edit a text file with nano or vim | nano config.txt or vim script.sh |
| find [path] -name [file] | Search a file by a name | find /home -name “*.jpg” |
| grep [pattern] [file] | Search text pattern in file | grep “error” logfile.txt |
| wc -l [file] | Count the number of lines in a file | wc -l users.txt → 42 users.txt |
| uptime | Show how long the system has been running | uptime → 14:35 up 5 days, 3:12, 2 users |
| whoami | Show current user | whoami → john |
| who | Show who is logged | who |
| id | Show current user id and groups | id → uid=1000(john) gid=1000(john)… |
| sudo [command] | Run the command as admin | sudo apt update |
| su [user] | Swith user | su – alice |
| passwd [user] | Changes the password | passwd bob |
| ping [host] | Test network connection | ping google.com |
| ip a | Show network interface | ip a |
| curl [url] | Download the content of an URL | curl -O https://example.com/file.iso |
| ssh [user]@[host] | Connect to remote machine via SSH | ssh john@192.168.1.100 |
| apt install [package] | Install package | sudo apt install nginx |
| apt remove [package] | Remove package | sudo apt remove vim |
| chmod [perm] [file] | Change file permissions | chmod 755 script.sh |
| chown [user]:[group] [file] | Change file owner | sudo chown www-data:www-data /var/www/html |
| tar -cfv file.tar [dir] | Create a tar archive | tar -cvf backup.tar /home/user/docs |
| tar -xvf file.tar | Extract a tar archive | tar -xvf backup.tar |
| tar -czvf file.tar.gz [dir] | Create compressed tar.gz archive | tar -czvf backup.tar.gz /var/www |
| tar -xzvf file.tar.gz | Extract compressed archive | tar -xzvf backup.tar.gz |
| zip -r file.zip | Create a zip file | zip -r archive.zip documents/ |
| unzip file.zip | Extract zip file | unzip archive.zip |
| ps | Show running process | ps aux |
| kill [PID] | Kill process by PID | kill 12345 or kill -9 12345 (force) |
| history | Show command history | history |
| !n | run the command number n from history | !123 (runs command #123) |
| !! | Repeat the last command | !! (useful with sudo: sudo !!) |
| Ctrl + c | Stop current command | (press while a command is running) |
| man [command] | Show a manual of specified command | man ls |
| echo [text] | Prints text or variable contents to the terminal. | echo “Hello World” or echo $PATH |
| wget [url] | Downloads files from a URL. | wget https://example.com/bigfile.zip |
| clear | Clears the terminal space | clear |
| date | Shows or sets the system date and time | date → Thu Nov 27 14:30:25 UTC 2025 |
| stat [file] | Shows detailed information about a file. | stat report.pdf |
| git clone [repu_url] | Clones a git repository. | git clone https://github.com/torvalds/linux.git |
| whereis | Find binary, source, and man page of a command | whereis python |