Bezplatný prevodník

Linux / Bash Príkazový Cheat Sheet

Komplexný cheat pre príkazy Linux a Bash. Vyhľadajte viac ako 80 základných príkazov s príkladmi, popismi a kopírovaním na jedno kliknutie.

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

O tomto nástroji

Komplexná rýchla referenčná príručka pre linux bash. Prehľadávajte bežne používané príkazy, syntax a príklady usporiadané podľa kategórií. Vyhľadávateľná a vhodná pre mobilné zariadenia – označte túto stránku záložkou, aby ste k nej mali okamžitý prístup, keď potrebujete rýchlu pripomienku.

Ako používať

  1. Prezrite si kategorizované referenčné sekcie.
  2. Pomocou vyhľadávacieho panela vyhľadajte konkrétne príkazy alebo syntax.
  3. Kliknutím na ľubovoľný záznam zobrazíte príklady použitia a vysvetlenia.
  4. Skopírujte príkazy priamo na použitie vo vašom termináli alebo editore.

Často kladené otázky

Je táto referencia aktuálna?
Odkaz pokrýva široko používané príkazy a syntax, ktoré sú stabilné vo všetkých verziách. Najnovšie doplnky alebo funkcie špecifické pre verziu nájdete v oficiálnej dokumentácii.
Môžem to použiť offline?
Po načítaní stránka funguje bez internetového pripojenia. Uložte si ho ako záložku pre rýchly prístup – všetok obsah sa vykreslí v prehliadači bez ďalších sieťových požiadaviek.
Je to komplexné alebo len základy?
Pokrýva najčastejšie používané príkazy a vzory, ktoré zvládajú 90 % každodenných úloh. Špeciálne alebo pokročilé funkcie nájdete v oficiálnej dokumentácii.
Môžem navrhnúť doplnky?
Naše referencie pravidelne aktualizujeme. Ak si všimnete chýbajúce príkazy alebo máte návrhy, dajte nám vedieť prostredníctvom našej kontaktnej stránky.