แปลงฟรี

ลินุกซ์ / ทุบตี แผ่นโกงคำสั่ง

แผ่นโกงคำสั่ง Linux และ Bash ที่ครอบคลุม ค้นหาคำสั่งที่จำเป็นมากกว่า 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

เกี่ยวกับเครื่องมือนี้

คู่มืออ้างอิงฉบับย่อที่ครอบคลุมสำหรับ linux bash เรียกดูคำสั่ง ไวยากรณ์ และตัวอย่างที่ใช้กันทั่วไปโดยจัดเรียงตามหมวดหมู่ ค้นหาได้และเหมาะกับมือถือ — บุ๊กมาร์กหน้านี้เพื่อการเข้าถึงได้ทันทีเมื่อคุณต้องการการแจ้งเตือนอย่างรวดเร็ว

วิธีใช้งาน

  1. เรียกดูส่วนอ้างอิงที่จัดหมวดหมู่
  2. ใช้แถบค้นหาเพื่อค้นหาคำสั่งหรือไวยากรณ์เฉพาะ
  3. คลิกที่รายการใดๆ เพื่อดูตัวอย่างการใช้งานและคำอธิบาย
  4. คัดลอกคำสั่งโดยตรงเพื่อใช้ในเทอร์มินัลหรือโปรแกรมแก้ไขของคุณ

คำถามที่พบบ่อย

การอ้างอิงนี้เป็นข้อมูลล่าสุดหรือไม่
ข้อมูลอ้างอิงครอบคลุมคำสั่งและไวยากรณ์ที่ใช้กันอย่างแพร่หลายซึ่งมีความเสถียรในเวอร์ชันต่างๆ หากต้องการทราบคุณสมบัติเพิ่มเติมหรือคุณลักษณะเฉพาะเวอร์ชันล่าสุด โปรดตรวจสอบเอกสารประกอบอย่างเป็นทางการ
ฉันสามารถใช้แบบออฟไลน์ได้หรือไม่?
เมื่อโหลดแล้ว หน้าเว็บจะทำงานได้โดยไม่ต้องเชื่อมต่ออินเทอร์เน็ต บุ๊กมาร์กไว้เพื่อการเข้าถึงที่รวดเร็ว — เนื้อหาทั้งหมดแสดงผลในเบราว์เซอร์โดยไม่ต้องร้องขอเครือข่ายเพิ่มเติม
เรื่องนี้ครอบคลุมหรือแค่พื้นฐาน?
ครอบคลุมคำสั่งและรูปแบบที่ใช้บ่อยที่สุดซึ่งจัดการ 90% ของงานประจำวัน สำหรับคุณสมบัติเฉพาะหรือขั้นสูง โปรดดูเอกสารอย่างเป็นทางการ
ฉันสามารถแนะนำเพิ่มเติมได้หรือไม่?
เราอัปเดตข้อมูลอ้างอิงของเราเป็นประจำ หากคุณสังเกตเห็นคำสั่งที่หายไปหรือมีข้อเสนอแนะ โปรดแจ้งให้เราทราบผ่านหน้าติดต่อของเรา