Command Line Interface (CLI) Part Part 2

cp Command
mv Command
cat /etc/hosts
touch Command
> Greater than Operator
touch Commnad
echo Command
nano Command


1.
cp Command => Directory ကို Copy ကူးခြင်း
(cp Command နောက်မှာ မူးရင်ဖိုင်ရဲ့ Location နဲ့ Copy ပွားရမယ့် Location တို့ကို ပေးဖို့လို့အပ်ပါတယ်။)

cp ~/Downloads/hello.txt ~/Pictures/hello.txt
(Download ထဲက hello.txt ဖိုင်ကို Pictures ထဲကို hello.txt ဖိုင်နဲ့ copy ကူးပေးသွားမှာ ဖြစ်ပါတယ်။

-r Option => Directory ကို ကူးလိုရင် -r Option ကို ထည့်ပေးရပါတယ်။
cp ~/Downloads/hi ~/Pictures/hi
(Download ထဲက hi ဆိုတဲ့ Directoryကို Pictures ထဲကို hi ဆိုတဲ့ Directory အနေနဲ့ copy ကူးပေးသွားမှာ ဖြစ်ပါတယ်။

2.
mv Command => ဖိုင်တွေ၊ Directory တွေကို move လုပ်ခြင်း
mv ~/Downloads/hi ~/Pictures/hi
(Download ထဲက hi ဆိုတဲ့ Directoryကို Pictures ထဲကို hi ဆိုတဲ့ Directory အနေနဲ့ move လုပ်ခြင်း)

mv command က Rename လုပ်ဖို့လည်း သုံးပါတယ်။
mv hi.txt hello.txt
(Home ထဲရှိ hi.txt ဖိုင်ကို hello.txt ဖိုင်အဖြစ် Rename ပြုလုပ်ခြင်း)

3.
cat /etc/hosts
Host အချက်အလက်ကို ဖော်ပြပေးမှာ ဖြစ်ပါတယ်။


4.
touch Commnad => ဖိုင်တစ်ခုတည်ဆောက်ခြင်း
touch hello.txt (Home Directory မှာ hello.txt ဖိုင်တစ်ခုတည်ဆောက်ခြင်း)

> = Greater than Operator (Terminal ထဲမှာ ls (Or) ls -l Command သုံးပြီး ရလာတဲ့ Output list တွေကို ဖိုင်တစ်ခုနဲ့ သိမ်းဆည်းခြင်း)

ls -l > filelist
(filelist ဆိုတဲ့ ဖိုင်အမည်နဲ့ Output list တွေကို သိမ်းဆည်ခြင်း)

echo Command => Terminal ထဲမှာ Output ရိုက်ထုတ်ခြင်း
echo “Hello, World” (Terminal ထဲမှာ Hello, World ကို Output ပြပေးပါမယ်)

> Greater than Operator နဲ့ တွဲသုံးရင် ဖိုင်ထဲမှာ Output ကို သိမ်းဆည်းပေးပါမယ်။
echo “Hello, World” > hello
(hello ဆိုတဲ့ ဖိုင်တစ်ခုတည်ဆောက်ပေးပြီး၊ Hello, World ဆိုတဲ့ စာသားကို ကို hello ဖိုင်ထဲမှာ သွားရေးပေးမှာပါ။)

5.
nano Command => ဖိုင်တစ်ခုကို ဖွင့်ပြင်ခြင်း
nano hello (Home ထဲမှာ ရှိတဲ့ hello ဖိုင်ကို Terminal ထဲမှာ Text Editor အနေနဲ့ ပြမယ်)
ကြိုက်သလိုပြင်ပြီး
Save လိုလျှင် Ctrl + O
Enter ခေါက်
nano ကို ပိတ်လိုရင် Ctrl + X

Shiney J 2 Feb 2020