1 Introduction

🐧 Linux is a Unix-based operating system widely used on servers, HPC clusters, and for scientific development.
This guide collects the most important commands to help you move efficiently within the terminal.


3 File Management

Command Description Example
cp Copy files or directories cp file.txt backup.txt
mv Move or rename files mv file.txt dati/file.txt
rm Delete files rm vecchio.txt
cat Display file contents cat note.txt
less Scroll through file content less lungo.txt
head / tail Show the first / last lines head -n 5 dati.txt

⚠️ Warning: rm permanently deletes files. Use rm -i to confirm each deletion.


4 Permissions and Ownership

Command Description Example
chmod Change file permissions chmod 755 script.sh
chown Change file owner chown user:group file.txt
ls -l Show file permissions ls -l

Note: Permissions are divided into three groups: user, group, and others (e.g., -rwxr-xr–).


5 Processes and Resources

Command Description Example
top Show active processes top
ps List processes ps aux
kill Terminate a process kill 1234
df -h Show disk usage df -h
du -sh Show folder size du -sh data/

Common error: If kill does not work, try kill -9 PID (force termination).


6 Searching and Filtering

Command Description Example
grep Search text in files grep "error" log.txt
find Search files in the filesystem find /home -name "*.txt"
sort Sort lines sort list.txt
uniq Remove duplicates uniq list.txt
wc Count lines, words, and characters wc -l file.txt

7 Archiving and Compression

Command Description Example
tar Create / extract archives tar -czf backup.tar.gz folder/
gzip / gunzip Compress / decompress files gzip data.txt
zip / unzip Create or extract zip archives zip -r data.zip folder/

8 Networking and System

Command Description Example
ping Test network connectivity ping google.com
ssh Remote connection ssh user@server
scp Copy files remotely scp file.txt user@server:/path/
uname -a System information uname -a
df -h Disk status df -h

⬅ Back to Home