Zdarma převodník

Linux / Bash Příkazový Cheat Sheet

Komplexní cheat pro příkazy Linux a Bash. Hledejte přes 80 základních příkazů s příklady, popisy a kopírováním na jedno kliknutí.

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

O tomto nástroji

Komplexní rychlá referenční příručka pro linux bash. Procházejte běžně používané příkazy, syntaxi a příklady uspořádané podle kategorií. Prohledávatelné a vhodné pro mobily – přidejte si tuto stránku do záložek, abyste k ní měli okamžitý přístup, když potřebujete rychlé připomenutí.

Jak používat

  1. Procházejte kategorizované referenční sekce.
  2. Pomocí vyhledávacího pole vyhledejte konkrétní příkazy nebo syntaxi.
  3. Kliknutím na libovolnou položku zobrazíte příklady použití a vysvětlení.
  4. Zkopírujte příkazy přímo pro použití ve vašem terminálu nebo editoru.

Často kladené dotazy

Je tato reference aktuální?
Odkaz pokrývá široce používané příkazy a syntaxi, které jsou stabilní napříč verzemi. Nejnovější přírůstky nebo funkce specifické pro verzi naleznete v oficiální dokumentaci.
Mohu to použít offline?
Po načtení stránka funguje bez připojení k internetu. Uložte si jej do záložek pro rychlý přístup – veškerý obsah se vykresluje v prohlížeči bez dalších síťových požadavků.
Je to komplexní nebo jen základní?
Pokrývá nejčastěji používané příkazy a vzory, které zvládají 90 % každodenních úkolů. Pro specializované nebo pokročilé funkce nahlédněte do oficiální dokumentace.
Mohu navrhnout doplňky?
Naše reference pravidelně aktualizujeme. Pokud si všimnete chybějících příkazů nebo máte návrhy, dejte nám vědět prostřednictvím naší kontaktní stránky.