Conversor Gratuito

Linux / Bash Folha de Referência de Comandos

Folha de referência completa de comandos Linux e Bash. Pesquise mais de 80 comandos essenciais com exemplos, descrições e cópia em um clique.

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

Sobre esta ferramenta

Um guia de referência rápida abrangente para Linux Bash. Procure comandos, sintaxe e exemplos comumente usados, organizados por categoria. Pesquisável e compatível com dispositivos móveis – marque esta página para acesso instantâneo quando precisar de um lembrete rápido.

Como usar

  1. Navegue pelas seções de referência categorizadas.
  2. Use a barra de pesquisa para encontrar comandos ou sintaxe específicos.
  3. Clique em qualquer entrada para ver exemplos de uso e explicações.
  4. Copie comandos diretamente para uso em seu terminal ou editor.

Perguntas frequentes

Esta referência está atualizada?
A referência abrange comandos e sintaxe amplamente utilizados que são estáveis entre versões. Para as últimas adições ou recursos específicos da versão, verifique a documentação oficial.
Posso usar isso off-line?
Depois de carregada, a página funciona sem conexão com a internet. Adicione-o aos favoritos para acesso rápido – todo o conteúdo é renderizado no navegador sem mais solicitações de rede.
Isso é abrangente ou apenas o básico?
Abrange os comandos e padrões mais comumente usados que lidam com 90% das tarefas diárias. Para recursos de nicho ou avançados, consulte a documentação oficial.
Posso sugerir acréscimos?
Atualizamos regularmente as nossas referências. Se você notar comandos ausentes ou tiver sugestões, avise-nos através de nossa página de contato.