Creating and removing · Tạo và xóa
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · Trang này cần trình duyệt gần đây (hỗ trợ SharedArrayBuffer). Vui lòng cập nhật Chrome, Edge, Firefox hoặc Safari lên phiên bản mới nhất.
English
Making things
mkdirmakes a directory;touchmakes an empty file:
- After these, you have a
notesfolder with an emptytodo.txtinside it.
Tiếng Việt
Tạo thứ gì đó
mkdirtạo một thư mục;touchtạo một file trống:
mkdir notes
touch notes/todo.txt
- Sau khi làm vậy, bạn sẽ có một thư mục
notesvới một file trốngtodo.txtbên trong.
English
Copying and moving
cpcopies a file;mvmoves (or renames) it:
mv old newis also how you rename something — moving it to a new name.
Tiếng Việt
SAO CHÉP VÀ DI CHUYỂN
cpsao chép một file;mvdi chuyển (hoặc đổi tên) nó:
cp hello.txt backup.txt
mv backup.txt notes/backup.txt
mv old newcũng là cách bạn đổi tên một thứ gì đó — di chuyển nó sang một tên mới.
English
Removing — carefully
rmremoves a file. To remove a folder and everything in it, add-r(recursive):
- ⚠️ There is no recycle bin on the command line.
rmis permanent — always check before you delete.
Tiếng Việt
Xóa — cẩn thận
rmxóa một file. Để xóa một thư mục và tất cả mọi thứ bên trong, hãy thêm-r(recursive):
rm backup.txt
rm -r notes
- ⚠️ Không có thùng rác trên dòng lệnh.
rmlà vĩnh viễn — luôn kiểm tra trước khi xóa.
English
Common mistakes
rmdeletes for good — there is no recycle bin.mkdirmakes a folder;rmdironly removes an empty one.
Tiếng Việt
Lỗi thường gặp
rmxóa mãi mãi — không có thùng rác.mkdirtạo một thư mục;rmdirchỉ xóa một thư mục trống.
Explore · Khám phá
Folders and files · Thư mục và tệp
mkdir / touch add to the tree; cd moves where you are. · mkdir / touch thêm vào cây; cd di chuyển nơi bạn đang ở.
Make a new folder called notes with mkdir notes. The check then lists the folder to confirm it appeared. · Tạo một thư mục mới tên là notes với mkdir notes. Lệnh kiểm tra sau đó liệt kê thư mục để xác nhận nó đã xuất hiện.
Make a copy of hello.txt named backup.txt using cp. · Sao chép hello.txt thành tên backup.txt bằng cách dùng cp.