Convertitore gratuito

Linux/Bash Foglio informativo dei comandi

Foglio informativo completo sui comandi Linux e Bash. Cerca oltre 80 comandi essenziali con esempi, descrizioni e copia con un clic.

ls
List directory contents
Esempio:ls -la /home/user
ls -la
List all files including hidden, with details
Esempio:ls -la ~/Documents
cd
Change directory
Esempio:cd /var/log
pwd
Print working directory path
Esempio:pwd
mkdir
Create a new directory
Esempio:mkdir -p /tmp/mydir/subdir
rm
Remove files or directories
Esempio:rm -rf /tmp/oldfiles
cp
Copy files or directories
Esempio:cp -r /src/dir /dst/dir
mv
Move or rename files/directories
Esempio:mv oldname.txt newname.txt
touch
Create an empty file or update timestamp
Esempio:touch newfile.txt
find
Search for files in a directory hierarchy
Esempio:find /home -name '*.log' -mtime -7
locate
Find files by name using a prebuilt database
Esempio:locate nginx.conf
ln
Create hard or symbolic links
Esempio:ln -s /path/to/target /path/to/link
df
Report disk space usage of file systems
Esempio:df -h
du
Estimate file space usage
Esempio:du -sh /var/log/*
stat
Display file or file system status
Esempio:stat /etc/passwd
file
Determine file type
Esempio:file /usr/bin/bash
cat
Concatenate and display file contents
Esempio:cat /etc/hosts
less
View file content one screen at a time
Esempio:less /var/log/syslog
more
View file content page by page
Esempio:more /etc/passwd
head
Output the first part of a file
Esempio:head -n 20 /var/log/auth.log
tail
Output the last part of a file
Esempio:tail -f /var/log/syslog
grep
Search text using patterns
Esempio:grep -rn 'error' /var/log/
sed
Stream editor for filtering and transforming text
Esempio:sed 's/old/new/g' file.txt
awk
Pattern scanning and text processing language
Esempio:awk '{print $1, $3}' access.log
sort
Sort lines of text files
Esempio:sort -k2 -n data.txt
uniq
Report or omit repeated lines
Esempio:sort file.txt | uniq -c
wc
Print newline, word, and byte counts
Esempio:wc -l /etc/passwd
cut
Remove sections from each line of files
Esempio:cut -d: -f1 /etc/passwd
tr
Translate or delete characters
Esempio:echo 'hello' | tr 'a-z' 'A-Z'
echo
Display a line of text
Esempio:echo "Hello, World!"
printf
Format and print data
Esempio:printf "%s\t%d\n" name 42
diff
Compare files line by line
Esempio:diff file1.txt file2.txt
tee
Read from stdin and write to stdout and files
Esempio:ls | tee output.txt
ps
Report a snapshot of current processes
Esempio:ps aux | grep nginx
top
Display Linux processes in real time
Esempio:top -u www-data
htop
Interactive process viewer (ncurses-based)
Esempio:htop
kill
Send a signal to a process
Esempio:kill -9 1234
killall
Kill processes by name
Esempio:killall firefox
bg
Resume a suspended job in the background
Esempio:bg %1
fg
Bring a job to the foreground
Esempio:fg %1
jobs
List active jobs in the current shell
Esempio:jobs -l
nohup
Run a command immune to hangups
Esempio:nohup ./script.sh &
nice
Run a command with modified scheduling priority
Esempio:nice -n 10 ./heavy_task.sh
systemctl
Control the systemd system and service manager
Esempio:systemctl restart nginx
service
Run a System V init script
Esempio:service apache2 status
ping
Send ICMP ECHO_REQUEST to network hosts
Esempio:ping -c 4 google.com
curl
Transfer data from or to a server
Esempio:curl -L -o file.zip https://example.com/file.zip
wget
Non-interactive network downloader
Esempio:wget -q https://example.com/file.tar.gz
ssh
OpenSSH remote login client
Esempio:ssh -i ~/.ssh/key.pem user@host
scp
Secure copy files between hosts
Esempio:scp user@host:/path/file.txt ./local/
rsync
Remote file copying tool with delta transfer
Esempio:rsync -avz /src/ user@host:/dst/
netstat
Print network connections and routing tables
Esempio:netstat -tulpn
ss
Utility to investigate sockets
Esempio:ss -tulwn
ifconfig
Configure a network interface
Esempio:ifconfig eth0
ip
Show and manipulate routing, devices, and tunnels
Esempio:ip addr show
nmap
Network exploration tool and port scanner
Esempio:nmap -sV 192.168.1.0/24
dig
DNS lookup utility
Esempio:dig +short A google.com
nslookup
Query Internet name servers interactively
Esempio:nslookup example.com
chmod
Change file mode bits (permissions)
Esempio:chmod 755 script.sh
chown
Change file owner and group
Esempio:chown -R www-data:www-data /var/www
chgrp
Change group ownership
Esempio:chgrp developers project/
sudo
Execute a command as another user (superuser)
Esempio:sudo systemctl restart nginx
su
Change user ID or become superuser
Esempio:su - postgres
passwd
Change user password
Esempio:passwd username
umask
Set or display the file mode creation mask
Esempio:umask 022
id
Print user and group information
Esempio:id username
whoami
Print the current effective user name
Esempio:whoami
groups
Print the groups a user is in
Esempio:groups username
tar
Archive files using tape archive format
Esempio:tar -czvf archive.tar.gz /path/to/dir
tar -x
Extract files from a tar archive
Esempio:tar -xzvf archive.tar.gz -C /target/
gzip
Compress files using GNU zip
Esempio:gzip -9 large_file.log
gunzip
Decompress gzip compressed files
Esempio:gunzip archive.tar.gz
zip
Package and compress files into a ZIP archive
Esempio:zip -r output.zip /path/to/dir
unzip
Extract files from a ZIP archive
Esempio:unzip archive.zip -d /target/
bzip2
Compress files using bzip2 algorithm
Esempio:bzip2 -z large_file.txt
xz
Compress files using the XZ algorithm
Esempio:xz -z -9 file.txt
uname
Print system information
Esempio:uname -a
uptime
Tell how long the system has been running
Esempio:uptime
free
Display amount of free and used memory
Esempio:free -h
lscpu
Display information about the CPU architecture
Esempio:lscpu
lsblk
List information about block devices
Esempio:lsblk -o NAME,SIZE,TYPE,MOUNTPOINT
lspci
List all PCI devices
Esempio:lspci -v | grep VGA
dmesg
Print or control the kernel ring buffer
Esempio:dmesg | tail -50
journalctl
Query and display messages from the journal
Esempio:journalctl -u nginx --since '1 hour ago'
history
Display the command history list
Esempio:history | grep docker
env
Print environment variables
Esempio:env | grep PATH
if / then / fi
Conditional execution in shell scripts
Esempio:if [ -f file.txt ]; then echo exists; fi
for
Loop over a list of items
Esempio:for i in 1 2 3; do echo $i; done
while
Execute commands while a condition is true
Esempio:while read line; do echo $line; done < file
case
Multi-branch conditional matching pattern
Esempio:case "$var" in a) echo A;; b) echo B;; esac
function
Define a shell function
Esempio:greet() { echo "Hello, $1!"; }; greet World
export
Set environment variables for child processes
Esempio:export MY_VAR=value
source
Execute commands from a file in current shell
Esempio:source ~/.bashrc
alias
Create an alias for a command
Esempio:alias ll='ls -la'
cron / crontab
Schedule commands to run periodically
Esempio:crontab -e # 0 * * * * /path/to/script.sh
at
Execute commands at a specified time
Esempio:echo 'ls /tmp' | at 14:30

Informazioni su questo strumento

Una guida completa di riferimento rapido per Linux Bash. Sfoglia comandi, sintassi ed esempi di uso comune organizzati per categoria. Ricercabile e ottimizzata per i dispositivi mobili: aggiungi questa pagina ai segnalibri per un accesso immediato quando hai bisogno di un promemoria rapido.

Come usarlo

  1. Sfoglia le sezioni di riferimento categorizzate.
  2. Utilizza la barra di ricerca per trovare comandi o sintassi specifici.
  3. Fare clic su qualsiasi voce per visualizzare esempi di utilizzo e spiegazioni.
  4. Copia i comandi direttamente per utilizzarli nel tuo terminale o editor.

Domande frequenti

Questo riferimento è aggiornato?
Il riferimento copre comandi e sintassi ampiamente utilizzati che sono stabili tra le versioni. Per le ultime aggiunte o funzionalità specifiche della versione, controlla la documentazione ufficiale.
Posso usarlo offline?
Una volta caricata, la pagina funziona senza connessione Internet. Aggiungilo ai segnalibri per un accesso rapido: tutto il contenuto viene visualizzato nel browser senza ulteriori richieste di rete.
È completo o solo le nozioni di base?
Copre i comandi e i modelli più comunemente utilizzati che gestiscono il 90% delle attività quotidiane. Per funzionalità di nicchia o avanzate consultare la documentazione ufficiale.
Posso suggerire delle integrazioni?
Aggiorniamo regolarmente le nostre referenze. Se noti comandi mancanti o hai suggerimenti, faccelo sapere tramite la nostra pagina dei contatti.