Learn how OpenClaw reads, writes, edits, and organizes files safely with trash > rm and git safety rules.Belajar bagaimana OpenClaw membaca, menulis, menyunting, dan mengatur fail dengan selamat menggunakan trash > rm dan peraturan keselamatan git.
📊Module ProgressKemajuan Modul
Complete objectives and quizzes to unlock your badge!Lengkapkan objektif dan kuiz untuk dapatkan lencana!
0/9 Tasks Completed0/9 Tugasan Selesai
🎯Learning ObjectivesObjektif Pembelajaran
Read Files — View contents of text files and documents using the read tool.Baca Fail — Lihat kandungan fail teks dan dokumen menggunakan tool read.
Write Files — Create new files or overwrite existing files using the write tool.Tulis Fail — Cipta fail baru atau tulis ganti fail sedia ada menggunakan tool write.
Edit Files — Make targeted changes to existing files with the edit tool.Sunting Fail — Buat perubahan sasaran kepada fail sedia ada dengan tool edit.
Organize Safely — Move, rename, and delete files safely using trash instead of rm.Atur dengan Selamat — Pindah, namakan semula, dan padam fail dengan selamat menggunakan trash bukannya rm.
📚TheoryTeori
What OpenClaw Can Do with FilesApa yang Boleh Dilakukan OpenClaw dengan Fail
OpenClaw can read, write, and edit files on your computer (with permission). This transforms it from a chat bot into a file management assistant.
OpenClaw boleh membaca, menulis, dan menyunting fail di komputer anda (dengan izin). Ini mengubahnya dari chatbot menjadi pembantu pengurusan fail.
1. Read Files1. Baca Fail
View contents of text files (.txt, .md, .json, .js, etc.)Lihat kandungan fail teks (.txt, .md, .json, .js, dll.)
Extract information from documentsEkstrak maklumat dari dokumen
Analyze code filesAnalisis fail kod
2. Write Files2. Tulis Fail
Create new files with specified contentCipta fail baru dengan kandungan tertentu
Save research notes, summaries, code snippetsSimpan not penyelidikan, ringkasan, potongan kod
Generate reportsJana laporan
3. Edit Files3. Sunting Fail
Make targeted changes to existing filesBuat perubahan sasaran ke fail sedia ada
Move files between foldersPindah fail antara folder
Rename files in bulkNamakan semula fail secara pukal
Create folder structuresCipta struktur folder
⚠️ Safety First!⚠️ Keselamatan Dahulu!
Danger Zone: Using rm (delete) is permanent on most systems. There's no "Recycle Bin."Menggunakan rm (padam) adalah kekal pada kebanyakan sistem. Tiada "Bandar Sampah".
Safe Zone: Using trash moves files to Recycle Bin/Trash. You can recover them!Menggunakan trash memindahkan fail ke Bandar Sampah. Anda boleh pulihkannya!
File Operation ToolsAlatan Operasi Fail
OpenClaw uses these tools (you don't need to type these, JiXe uses them):
OpenClaw menggunakan alatan ini (anda tidak perlu taip, JiXe yang menggunakannya):
ALWAYS check pwd (print working directory) before git operations
NEVER run git reset --hard without confirming directory
Use git status to see what's changed before committing
Jika anda bekerjaya dengan kod:
SELALU periksa pwd (print working directory) sebelum operasi git
JANGAN PERNAH jalankan git reset --hard tanpa sahkan direktori
Guna git status untuk lihat perubahan sebelum commit
True story: On April 5, 2026, JiXe accidentally deleted the entire workspace with git reset --hard. Never again!
Cerita sebenar: Pada 5 April 2026, JiXe terkirim memadam keseluruhan workspace dengan git reset --hard. Jangan ulangi!
Key TakeawayAmalan Utama
File operations make OpenClaw powerful — but with great power comes great responsibility. trash > rm, always verify paths, and be careful with git!
Operasi fail menjadikan OpenClaw powerful — tetapi dengan kuasa besar datang tanggungan besar. trash > rm, sentiasa sahkan path, dan berhati-hati dengan git!
🧪Hands-On ExerciseLatihan Amali
Practice file operations safely in a simulated environment.
Amalkan operasi fail dengan selamat dalam persekitaran disimulasikan.
Step 1: Read a FileLangkah 1: Baca Fail
You: "Read the file TOOLS.md and tell me what API keys are stored."
Anda: "Baca fail TOOLS.md dan beritahu saya API keys apa yang disimpan."
JiXe: uses read tool → "I found these API keys in TOOLS.md: Brevo, Gemini, Groq (expired), Brave Search..."
JiXe: guna tool read → "Saya temui API keys ini dalam TOOLS.md: Brevo, Gemini, Groq (tamat), Brave Search..."
Step 2: Create a New FileLangkah 2: Cipta Fail Baharu
You: "Create a file called 'my-ideas.txt' with content: 'Idea 1: Build an AI course. Idea 2: Learn coding.'"
Anda: "Cipta fail bernama 'my-ideas.txt' dengan kandungan: 'Idea 1: Build an AI course. Idea 2: Learn coding.'"
JiXe: uses write tool → "Created my-ideas.txt with your ideas!"
JiXe: guna tool write → "my-ideas.txt dibina dengan idea anda!"
Step 3: Edit the FileLangkah 3: Sunting Fail
You: "Add 'Idea 3: Start a YouTube channel' to my-ideas.txt."
Anda: "Tambah 'Idea 3: Start a YouTube channel' ke my-ideas.txt."
JiXe: reads file, then uses write tool to append → "Added Idea 3 to the file!"
JiXe: baca fail, kemudian guna tool write untuk tambah → "Idea 3 ditambah ke fail!"
Step 4: Safe DeletionLangkah 4: Pemadaman Selamat
You: "Delete the file 'old-draft.txt'."
Anda: "Padam fail 'old-draft.txt'."
JiXe: uses trash tool → "Moved old-draft.txt to Recycle Bin. You can recover it if needed."
JiXe: guna tool trash → "Dipindah ke Bandar Sampah. Anda boleh pulih jika perlu."