Фрее Цонвертер

Линук / Басх Цомманд Цхеат Схеет

Свеобухватна варалица за Линук и Басх команде. Претражите 80+ основних команди са примерима, описима и копирањем једним кликом.

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

О овом алату

Свеобухватан водич за брзе референце за линук басх. Прегледајте најчешће коришћене команде, синтаксу и примере организоване по категоријама. Претражива и прилагођена мобилним уређајима — обележите ову страницу за тренутни приступ када вам затреба брз подсетник.

Како користити

  1. Прегледајте категорисане референтне одељке.
  2. Користите траку за претрагу да бисте пронашли одређене команде или синтаксу.
  3. Кликните на било који унос да бисте видели примере употребе и објашњења.
  4. Копирајте команде директно за употребу у вашем терминалу или уређивачу.

Често постављана питања

Да ли је ова референца ажурирана?
Референца покрива широко коришћене команде и синтаксу које су стабилне у различитим верзијама. За најновије додатке или карактеристике специфичне за верзију, погледајте званичну документацију.
Могу ли да користим ово ван мреже?
Када се учита, страница ради без интернет везе. Означите га за брзи приступ — сав садржај се приказује у претраживачу без даљих мрежних захтева.
Да ли је ово свеобухватно или само основе?
Покрива најчешће коришћене команде и обрасце који се баве 90% свакодневних задатака. За нишне или напредне функције погледајте званичну документацију.
Могу ли да предложим додатке?
Редовно ажурирамо наше референце. Ако приметите да недостају команде или имате предлоге, обавестите нас преко наше контакт странице.