ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်
Terminal (window) ထဲမှာ Shell (program) က run နေပါတယ်။ Shell အများဆုံးသုံးတာက Bash (Bourne Again Shell) ဖြစ်ပြီး ဒီ tutorial တစ်ခုလုံး Bash ကို base ထားပါမယ်။ Prompt ဆိုတာ command ရိုက်ဖို့ shell က စောင့်နေတဲ့ signal ပါ — user$ ဆိုရင် ordinary user, root# ဆိုရင် admin (root) user ကို ဆိုလိုပါတယ်။ GUI (mouse click) ကို 'friend က ညွှန်ပြပေးတာ'၊ terminal command ကို 'friend ကို တိတိကျကျ ညွှန်ကြားတာ' လို့ ခိုင်းနှိုင်းလို့ရပါတယ် — ညွှန်ကြားချက် တိကျရင် ရလဒ်ကလည်း တိကျပါတယ်။
လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်
Terminal ဖွင့်ပြီး command ရိုက်တဲ့အခါ Enter နှိပ်မှ run ပါတယ်။ Command တစ်ခုချင်းစီက program name + option (flag) + argument ပုံစံနဲ့ ဖွဲ့စည်းထားပါတယ်။ ဥပမာ ls -la /home ဆိုရင် ls = program, -la = option, /home = argument ပါ။ ဒီ pattern ကို tutorial အတွင်းလုံး ထပ်ခါထပ်ခါ တွေ့ရမှာမို့ အခုကတည်းက အကျင့်ဖြစ်အောင် သတိထားကြည့်ပါ။
အတူတူ terminal ထဲ စမ်းမယ်
# Anatomy of a command
ls -la /home
# └┬┘ └┬┘ └──┬──┘
# program option argument
# Check which shell you're using
echo $SHELLPrompt ရဲ့ $ / # သင်္ကေတကနေ user ဘယ်သူဆိုတာ ခွဲနိုင်မည်။၅ မိနစ် စမ်းကြည့်
Terminal ဖွင့်ပြီး echo $SHELL ရိုက်ကြည့်ပါ။ ရလဒ်ကို ကူးပြီး ဒါက ဘယ် shell လဲ ရေးပါ။
သတိလေးတစ်ချက်
Prompt ရှေ့မှာ # ပေါ်နေရင် သတိထားပါ — root အနေနဲ့ command အကုန် run ခွင့်ရှိပါတယ်၊ မှားရင် ပြန်ပြင်ရခက်နိုင်ပါတယ်။