📱 Học IELTS miễn phí: App IELTS 6.0

Giới thiệu

Bạn dùng ls, grep, chmod hàng ngày, nhưng có bao giờ tự hỏi: các lệnh này viết tắt của gì? Hiểu nghĩa gốc tiếng Anh giúp bạn nhớ lệnh nhanh hơn, đỡ phải Google, và tự tin đọc documentation.

Thực tế: Rất nhiều developer Việt dùng Linux command line theo thói quen — biết gõ nhưng không biết nghĩa, gặp lệnh mới là bối rối. Đặc biệt khi đọc man page hay viết shell script, tiếng Anh là rào cản lớn.

Bài viết này giúp bạn:

  • Hiểu nghĩa gốc tiếng Anh của 40+ lệnh Linux phổ biến
  • Đọc hiểu man page — không còn sợ wall of text
  • Nắm từ vựng shell scripting để viết script chuyên nghiệp
  • Biết cách diễn đạt Linux tasks bằng tiếng Anh

1. Gốc tiếng Anh của các lệnh cơ bản — Command Origins

Nhiều lệnh Linux là viết tắt tiếng Anh. Biết gốc = nhớ luôn:

LệnhViết tắt củaIPANghĩa
lslist/lɪst/Liệt kê file và thư mục
cdchange directory/tʃeɪndʒ dəˈrɛktəri/Chuyển thư mục
pwdprint working directory/prɪnt ˈwɜːkɪŋ dəˈrɛktəri/In ra thư mục hiện tại
mkdirmake directory/meɪk dəˈrɛktəri/Tạo thư mục
rmdirremove directory/rɪˈmuːv dəˈrɛktəri/Xóa thư mục (rỗng)
rmremove/rɪˈmuːv/Xóa file
cpcopy/ˈkɒpi/Sao chép file
mvmove/muːv/Di chuyển / đổi tên file
catconcatenate/kənˈkætəneɪt/Nối và hiển thị nội dung file
touchtouch/tʌtʃ/“Chạm” vào file — tạo mới hoặc cập nhật timestamp
echoecho/ˈɛkəʊ/Phản hồi — in text ra terminal

💡 Bạn có biết?

  • cat không liên quan đến con mèo 🐱 — nó là concatenate (nối chuỗi). Ban đầu dùng để nối nhiều file: cat file1 file2 > merged
  • touch ban đầu chỉ để update timestamp, nhưng developer hay dùng để tạo file rỗng
  • echo nghĩa là tiếng vọng — terminal “vọng lại” text bạn gõ

2. File Permissions & Ownership — Quyền & sở hữu file

Lệnh / Thuật ngữViết tắt củaIPANghĩa
chmodchange mode/tʃeɪndʒ məʊd/Thay đổi quyền truy cập file
chownchange owner/tʃeɪndʒ ˈəʊnər/Thay đổi chủ sở hữu file
chgrpchange group/tʃeɪndʒ ɡruːp/Thay đổi group sở hữu file
sudosuperuser do/ˈsuːduː/Thực thi lệnh với quyền superuser
suswitch user/swɪtʃ ˈjuːzər/Chuyển sang user khác
rwxread, write, executeĐọc, ghi, thực thi

📌 Giải nghĩa permission string

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
-rwxr-xr--  1  cuong  dev  4096  Mar 17  app.sh

# Chia thành 4 phần:
# -    → file type (- = regular file, d = directory, l = link)
# rwx  → owner permissions (read + write + execute)
# r-x  → group permissions (read + execute, no write)
# r--  → others permissions (read only)

# Số tương ứng:
# r = 4 (read)
# w = 2 (write)
# x = 1 (execute)
# rwx = 4+2+1 = 7
# r-x = 4+0+1 = 5
# r-- = 4+0+0 = 4
# → chmod 754 app.sh

Mẫu câu hay dùng:

EnglishTiếng Việt
“Make the script executable.”Cho script quyền chạy (execute).
“Change the file owner to www-data.”Đổi chủ sở hữu file sang www-data.
“This file has world-readable permissions.”File này ai cũng đọc được — nguy hiểm.
“Run this command with elevated privileges.”Chạy lệnh với quyền nâng cao (sudo).

3. Tìm kiếm & Xử lý text — Search & Text Processing

LệnhViết tắt củaIPANghĩa
grepglobal regular expression print/ɡrɛp/Tìm kiếm text theo pattern
sedstream editor/sɛd/Chỉnh sửa text theo luồng
awkAho, Weinberger, Kernighan/ɔːk/Ngôn ngữ xử lý text (tên 3 tác giả)
findfind/faɪnd/Tìm file theo điều kiện
sortsort/sɔːt/Sắp xếp
wcword count/wɜːd kaʊnt/Đếm dòng, từ, ký tự
headhead/hɛd/Hiển thị phần đầu file
tailtail/teɪl/Hiển thị phần cuối file
diffdifference/ˈdɪfərəns/So sánh sự khác nhau giữa 2 file
teeT (hình chữ T)/tiː/Chia output thành 2 nhánh — terminal + file

💡 Bạn có biết?

  • grep = Global Regular Expression Print — từ lệnh g/re/p trong editor ed
  • awk được đặt theo tên 3 tác giả: Aho, Weinberger, Kernighan
  • tee giống ống nước hình chữ T — chia luồng data ra 2 hướng

Ví dụ thực tế:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Tìm tất cả file chứa "TODO" trong project
grep -rn "TODO" ./src/
# -r = recursive (đệ quy), -n = line number (số dòng)

# Đếm số dòng code trong project (không tính blank lines)
find . -name "*.py" | xargs wc -l
# "Find all Python files and count their lines"

# Xem 20 dòng cuối của log file (real-time)
tail -f -n 20 /var/log/app.log
# -f = follow (theo dõi liên tục), -n = number of lines

# Thay thế text trong file
sed -i 's/localhost/production.server.com/g' config.yml
# s = substitute (thay thế), g = global (toàn bộ)

4. Process & System — Quản lý tiến trình & hệ thống

LệnhViết tắt củaIPANghĩa
psprocess status/ˈprɒsɛs ˈsteɪtəs/Trạng thái các tiến trình
toptable of processes/teɪbl əv ˈprɒsɛsɪz/Bảng tiến trình real-time
killkill/kɪl/Gửi signal dừng tiến trình
bgbackground/ˈbækɡraʊnd/Chạy tiến trình ở nền
fgforeground/ˈfɔːɡraʊnd/Đưa tiến trình lên nổi
nohupno hang up/nəʊ hæŋ ʌp/Không dừng khi đóng terminal
dfdisk free/dɪsk friː/Dung lượng ổ đĩa trống
dudisk usage/dɪsk ˈjuːsɪdʒ/Dung lượng đã dùng
freefree/friː/Bộ nhớ (RAM) trống
uptimeuptime/ˈʌptaɪm/Thời gian hệ thống chạy liên tục

📌 Signal names — Tên tín hiệu

1
2
3
4
5
6
7
8
kill -SIGTERM 1234   # TERM = terminate — yêu cầu dừng lịch sự
kill -SIGKILL 1234   # KILL = giết ngay — không thương lượng (signal 9)
kill -SIGHUP 1234    # HUP = hang up — reload config
kill -SIGINT 1234    # INT = interrupt — như nhấn Ctrl+C

# Mẹo nhớ:
# SIGTERM = "Please stop" (lịch sự, process có thể cleanup)
# SIGKILL = "STOP NOW!" (bắt buộc, không cleanup)

5. Networking — Mạng

LệnhViết tắt củaIPANghĩa
sshsecure shell/sɪˈkjʊər ʃɛl/Kết nối terminal từ xa, mã hóa
scpsecure copy/sɪˈkjʊər ˈkɒpi/Sao chép file từ xa, mã hóa
curlclient URL/kɜːl/Gửi request đến URL
wgetweb get/wɛb ɡɛt/Tải file từ web
pingping/pɪŋ/Kiểm tra kết nối mạng
netstatnetwork statistics/ˈnɛtwɜːk stəˈtɪstɪks/Thống kê kết nối mạng
ifconfiginterface configuration/ˈɪntəfeɪs kənˌfɪɡjəˈreɪʃən/Cấu hình network interface

Ví dụ thực tế:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# SSH vào server
ssh [email protected] -i ~/.ssh/id_rsa
# "Secure shell into production server using private key"

# Copy file lên server
scp ./build.zip deploy@server:/var/www/
# "Securely copy the build archive to the server"

# Test API endpoint
curl -X POST https://api.example.com/users \
  -H "Content-Type: application/json" \
  -d '{"name": "Cuong"}'
# -X = request method, -H = header, -d = data

6. Đọc Man Page — Reading Manual Pages

man = manual (tài liệu hướng dẫn). Đây là skill cực quan trọng:

Cấu trúc man page:

SectionNghĩaVí dụ
NAMETên lệnh + mô tả ngắngrep - print lines that match patterns
SYNOPSISCú pháp sử dụnggrep [OPTION]... PATTERNS [FILE]...
DESCRIPTIONMô tả chi tiếtGiải thích cách lệnh hoạt động
OPTIONSCác tùy chọn (flags)-i, -r, -n, -v
EXAMPLESVí dụ sử dụngCâu lệnh mẫu
SEE ALSOLệnh liên quanegrep(1), fgrep(1)
EXIT STATUSMã trả về0 = success, 1 = no match, 2 = error

💡 Cách đọc SYNOPSIS:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
grep [OPTION]... PATTERNS [FILE]...

# Quy ước:
# [OPTION]    → ngoặc vuông = optional (không bắt buộc)
# PATTERNS    → không ngoặc = required (bắt buộc)
# ...         → có thể lặp lại nhiều lần
# |           → hoặc (chọn 1 trong các option)
# UPPERCASE   → bạn thay bằng giá trị thực

# Ví dụ:
# cp [OPTION]... SOURCE DEST
# → cp là bắt buộc, OPTION tùy chọn, SOURCE và DEST bắt buộc

Từ vựng hay gặp trong man page:

Từ tiếng AnhIPANghĩa
invoke/ɪnˈvəʊk/Gọi, thực thi (lệnh)
suppress/səˈprɛs/Ẩn, không hiển thị
verbose/vɜːˈbəʊs/Chi tiết, hiển thị nhiều thông tin (-v)
recursive/rɪˈkɜːsɪv/Đệ quy — xử lý cả thư mục con (-r)
truncate/ˈtrʌŋkeɪt/Cắt ngắn, giới hạn độ dài
delimiter/dɪˈlɪmɪtər/Ký tự phân tách (comma, tab, space)
pipe/paɪp/Ống dẫn — nối output lệnh này vào input lệnh kia (|)
redirect/ˌriːdəˈrɛkt/Chuyển hướng output (>, », <)
wildcard/ˈwaɪldkɑːd/Ký tự đại diện (*, ?, [])
glob/ɡlɒb/Pattern matching file name (*.txt, data??.csv)

7. Shell Scripting — Từ vựng viết script

Thuật ngữIPANghĩa
shebang (#!)/ʃɪˈbæŋ/Dòng đầu script chỉ định interpreter
variable/ˈvɛəriəbl/Biến — lưu giá trị
environment variable/ɪnˈvaɪrənmənt/Biến môi trường — cấu hình hệ thống
exit code/ˈɛɡzɪt kəʊd/Mã trả về — 0 = thành công, khác 0 = lỗi
stdin / stdout / stderrInput chuẩn / output chuẩn / error chuẩn
daemon/ˈdiːmən/Tiến trình chạy nền (background service)

Ví dụ shell script với chú thích:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Shebang line — tells OS to use bash interpreter

# Variables (biến)
APP_NAME="my-app"
LOG_DIR="/var/log/${APP_NAME}"

# Conditional (điều kiện)
if [ -d "$LOG_DIR" ]; then
    echo "Log directory exists"       # directory exists
else
    mkdir -p "$LOG_DIR"               # make directory with parents
    echo "Created log directory"
fi

# Loop (vòng lặp)
for file in *.log; do
    echo "Processing: $file"          # iterate over log files
    gzip "$file"                      # compress each file
done

# Exit code (mã trả về)
if [ $? -eq 0 ]; then
    echo "Success"                    # $? = exit code of last command
    exit 0                            # 0 = success
else
    echo "Failed" >&2                 # >&2 = redirect to stderr
    exit 1                            # non-zero = failure
fi

8. Practice — Bài tập thực hành

Bài 1: Nối lệnh với nghĩa gốc

LệnhNghĩa gốc
1. grepa) change mode
2. chmodb) secure shell
3. sshc) word count
4. wcd) global regular expression print
5. sudoe) superuser do
📝 Đáp án

1-d, 2-a, 3-b, 4-c, 5-e

Bài 2: Đọc hiểu man page

Đọc đoạn sau từ man grep và trả lời câu hỏi:

-i, --ignore-case Ignore case distinctions in patterns and input data, so that characters that differ only in case match each other.

Câu hỏi: grep -i "error" log.txt sẽ tìm được những gì?

📝 Đáp án

Tìm được: “error”, “Error”, “ERROR”, “eRrOr” — tất cả các biến thể hoa/thường.

-i = ignore case = bỏ qua phân biệt chữ hoa/thường.

Bài 3: Dịch task sang lệnh Linux

Dịch các câu tiếng Anh sau thành lệnh Linux:

  1. “List all files including hidden ones in the current directory”
  2. “Find all Python files modified in the last 7 days”
  3. “Count the number of lines in all JavaScript files”
📝 Đáp án
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 1. List all files including hidden ones
ls -la
# -l = long format, -a = all (including hidden)

# 2. Find Python files modified in last 7 days
find . -name "*.py" -mtime -7
# -name = filename pattern, -mtime -7 = modified time < 7 days

# 3. Count lines in all JS files
find . -name "*.js" | xargs wc -l
# find → xargs → wc: pipeline pattern

Kết luận

Hiểu tiếng Anh đằng sau Linux command line giúp bạn:

  • Nhớ lệnh nhanh hơn — biết chmod = change mode thì không bao giờ quên
  • Đọc man page tự tin — không còn sợ wall of text tiếng Anh
  • Debug nhanh hơn — hiểu error message, đọc log dễ dàng
  • Viết script chuyên nghiệp — comment rõ ràng, variable naming chuẩn

📌 Tip: Khi gặp lệnh mới, thử man <command> hoặc <command> --help trước khi Google. Đọc man page là kỹ năng cần luyện tập!


Bạn thấy bài viết hữu ích? Chia sẻ cho đồng nghiệp đang dùng Linux hàng ngày nhé! 🐧