Creating and removing · การสร้างและการลบ
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · หน้านี้ต้องใช้เบราว์เซอร์ล่าสุด (รองรับ SharedArrayBuffer) กรุณาอัปเดต Chrome, Edge, Firefox หรือ Safari เป็นเวอร์ชันล่าสุด
English
Making things
mkdirmakes a directory;touchmakes an empty file:
- After these, you have a
notesfolder with an emptytodo.txtinside it.
ไทย
การสร้างสิ่งต่างๆ
- คำสั่ง
mkdirสร้าง-directory; คำสั่งtouchสร้างไฟล์ว่าง:
mkdir notes
touch notes/todo.txt
- หลังจากรันคำสั่งเหล่านี้ คุณจะไดโฟลเดอร์
notesที่มีไฟล์todo.txtว่างอยู่ด้านใน
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.
ไทย
การคัดลอกและย้าย
- คำสั่ง
cpคัดลอกไฟล์; คำสั่งmvย้าย (หรือเปลี่ยนชื่อ) ไฟล์:
cp hello.txt backup.txt
mv backup.txt notes/backup.txt
- คำสั่ง
mv old newยังเป็นวิธี เปลี่ยนชื่อ สิ่งต่างๆ — โดยการย้ายไปไว้ที่ชื่อใหม่
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.
ไทย
การลบ — ทำด้วยความระมัดระวัง
- คำสั่ง
rmลบไฟล์若要删除文件夹及其所有内容,请添加-r(递归):
rm backup.txt
rm -r notes
- ⚠️ ไม่มีถังขยะ ในคำสั่ง command line คำสั่ง
rmลบถาวร — ตรวจสอบทุกครั้งก่อนลบ
English
Common mistakes
rmdeletes for good — there is no recycle bin.mkdirmakes a folder;rmdironly removes an empty one.
ไทย
ข้อผิดพลาดที่พบบ่อย
- คำสั่ง
rmลบตลอดกาล — ไม่มีถังขยะ - คำสั่ง
mkdirสร้างโฟลเดอร์; คำสั่งrmdirลบได้เฉพาะโฟลเดอร์ ว่าง เท่านั้น
Explore · สำรวจ
Folders and files · โฟลเดอร์และไฟล์
mkdir / touch add to the tree; cd moves where you are. · mkdir / touch เพิ่มลงในต้นไม้; cd ย้ายตำแหน่งที่คุณอยู่
Make a new folder called notes with mkdir notes. The check then lists the folder to confirm it appeared. · สร้างโฟลเดอร์ใหม่ชื่อ notes ด้วย mkdir notes การตรวจสอบจะแสดงรายการโฟลเดอร์เพื่อยืนยันว่ามันปรากฏขึ้นมา
Make a copy of hello.txt named backup.txt using cp. · สร้างสำเนาของ hello.txt ชื่อ backup.txt โดยใช้ cp