Mervia AcademyLearn
ห้องศึกษาThe Studyพื้นที่อ่านคู่มืออ้างอิงWhere reference guides live
ห้องศึกษา · คู่มือThe Study · Guide

Terminal พื้นฐานสำหรับใช้ Claude Codeterminal basics for Claude Code

คู่มือสั้นแบบมีวิดีโอนำสำหรับ pwd, ls, cd และการเปิด Claude Code จากโฟลเดอร์ workspace ที่ถูกต้องa short video-first guide to pwd, ls, cd, and opening Claude Code from the right workspace folder

─── วิดีโอ─── video
video placeholder
วิดีโอ Terminal พื้นฐานสำหรับ Claude CodeTerminal basics video for Claude Code
ดูวิดีโอนี้หลังติดตั้ง Claude Code แล้ว เพื่อเปิด Claude จากโฟลเดอร์ที่ถูกต้องWatch this after installing Claude Code so you can open Claude from the right folder.

This is not a full command line course. You only need enough Terminal to start Claude Code from the right folder.

The rule is simple: Claude Code works from the folder where you run claude. If you run it from the wrong folder, Claude sees the wrong context.

For a quick demo, open Terminal 101: learn to navigate. It shows Terminal and a file explorer side by side: type commands on the left and watch the folders change on the right; click a folder on the right and it shows the command that click was hiding.

the three questions

Use Terminal to answer three questions:

  1. Where am I?
  2. What is in here?
  3. How do I move into the right folder?

Those map to three commands.

where am I: pwd

pwd

pwd prints the current folder. It may look like:

/Users/yourname/Desktop

You do not need to memorize the whole path. Just check the ending and make sure it matches where you think you are.

what is in here: ls

ls

ls lists the files and folders in the current folder.

On Windows PowerShell, ls also works. You may also see people use dir.

move folders: cd

Go into a folder:

cd folder-name

Go back one level:

cd ..

Go to Desktop on Mac:

cd ~/Desktop

If a folder name is long, type the first few letters and press Tab. Terminal can autocomplete the rest.

open the course workspace

After downloading and unzipping the starter workspace, put it somewhere easy to find, such as Desktop.

Then:

cd ~/Desktop
ls
cd claude-code-zero-to-hero-workspace
pwd
ls

The exact folder name may differ. The important part is that pwd ends with the workspace folder and ls shows the course files.

start Claude from the right folder

Only after you are inside the workspace, run:

claude

Then ask:

What is in this workspace, and what is this class likely using it for?

If Claude can explain the workspace, you opened it from the right folder.

quick recap

  • pwd = where am I?
  • ls = what is in here?
  • cd folder-name = go into a folder
  • cd .. = go back one level
  • clear = clean the screen; it does not delete files
  • run claude only after you are in the right workspace folder

นี่ไม่ใช่คอร์ส command line เต็มรูปแบบครับ เราเรียนแค่เท่าที่ต้องใช้เพื่อเปิด Claude Code จากโฟลเดอร์ที่ถูกต้อง

กฎสำคัญคือ Claude Code จะทำงานจากโฟลเดอร์ที่เราพิมพ์ claude ขึ้นมา ถ้าเปิดจากผิดโฟลเดอร์ Claude ก็จะเห็นบริบทผิด

ถ้าอยากเห็นภาพเร็ว ๆ ให้เปิด Terminal 101: learn to navigate หน้านี้วาง Terminal กับ file explorer ไว้ข้างกัน: พิมพ์คำสั่งด้านซ้ายแล้วดูโฟลเดอร์ด้านขวาเปลี่ยน หรือคลิกโฟลเดอร์ด้านขวาแล้วดูว่าการคลิกนั้นคือคำสั่งอะไรใน Terminal

คำถามสามข้อ

ใช้ Terminal ตอบแค่สามคำถามนี้ให้ได้:

  1. ตอนนี้เราอยู่ที่ไหน?
  2. ในนี้มีอะไร?
  3. จะเข้าโฟลเดอร์ที่ถูกต้องยังไง?

สามคำถามนี้ตรงกับสามคำสั่งหลัก

เราอยู่ที่ไหน: pwd

pwd

pwd จะบอกว่า terminal ตอนนี้อยู่ที่โฟลเดอร์ไหน อาจหน้าตาประมาณนี้:

/Users/yourname/Desktop

ไม่ต้องจำ path ทั้งบรรทัด แค่ดูท้าย path ว่าตรงกับที่เราคิดไว้ไหม

ในนี้มีอะไร: ls

ls

ls คือ list ว่าในโฟลเดอร์นี้มีไฟล์หรือโฟลเดอร์อะไรบ้าง

บน Windows PowerShell ใช้ ls ได้เหมือนกัน หรือบางคนอาจใช้ dir

เข้าออกโฟลเดอร์: cd

เข้าโฟลเดอร์:

cd folder-name

ย้อนกลับหนึ่งชั้น:

cd ..

ไป Desktop บน Mac:

cd ~/Desktop

ถ้าชื่อโฟลเดอร์ยาว ให้พิมพ์ตัวแรก ๆ แล้วกด Tab เพื่อให้ Terminal ช่วยเติมชื่อให้

เปิด workspace ของคลาส

หลังดาวน์โหลดและแตกไฟล์ starter workspace แล้ว แนะนำให้วางไว้ที่ที่หาเจอง่าย เช่น Desktop

จากนั้น:

cd ~/Desktop
ls
cd claude-code-zero-to-hero-workspace
pwd
ls

ชื่อโฟลเดอร์จริงอาจต่างจากตัวอย่างได้ จุดสำคัญคือ pwd ควรลงท้ายด้วยชื่อ workspace และ ls ควรเห็นไฟล์ของคอร์ส

เปิด Claude จากโฟลเดอร์ที่ถูกต้อง

หลังจากเข้า workspace แล้ว ค่อยรัน:

claude

จากนั้นลองถาม:

ช่วยอธิบายหน่อยว่าโฟลเดอร์นี้มีอะไรบ้าง และคลาสนี้น่าจะให้เราใช้ทำอะไร

ถ้า Claude อธิบาย workspace กลับมาได้ แปลว่าเราเปิดจากโฟลเดอร์ถูกต้องแล้ว

สรุปสั้น ๆ

  • pwd = ตอนนี้เราอยู่ที่ไหน
  • ls = ในนี้มีอะไร
  • cd folder-name = เข้าโฟลเดอร์
  • cd .. = ย้อนกลับหนึ่งชั้น
  • clear = ล้างหน้าจอ ไม่ได้ลบไฟล์
  • รัน claude หลังจากอยู่ใน workspace ที่ถูกต้องแล้วเท่านั้น