Essential Ubuntu Basic Commands
Linux basic command များ အကြောင်းကို Ubuntu အသုံးပြုပြီး လေ့လာသွားမှာ ဖြစ်ပါတယ်။ ကျတော်ကိုယ်တိုင် Ubuntu 22.0.04 ကို စမ်းသုံးကြည့်ရင်းလေ့လာထားတာများကို noted down ချရေးထားသည်များကို မျှဝေထားတာဖြစ်ပါတယ်။
1. Open the Terminal (Shortcut Clrt+Alt+T)
Linux command များ ရိုက်ရန် terminal/prompt ဖွင့်ရန် application icon မှ တဆင့် search box မှ terminal လို့ ရိုက်ရှာ၍သြော် လည်းကောင်း သို့မဟုတ် shortcut အနေဖြင့် Ctrl+Alt+T နှိပ်၍ ဖွင့်နိုင်သည်။
Click the Terminal prompt to make sure the cursor starts to type some command.
အခြေခံ command များစတင်ရိုက်နိုင်ရန် cursor အား prompt ပေါ်တွင် ရောက်ရှိနေကြောင်းသေချာပါစေ။ သေချာစေရန် Terminal/prompt window အား click ၍ cursor အား focus လုပ်ပါ၊ cursor လေး blink ဖြစ်နေပါက commands များရိုက်ရန် အဆင့်သင့် ဖြစ်နေပါပြီ။
2. Very basic and first command
- whoami - check user name - လက်ရှိ အသုံးပြုနေသော user အားစစ်ဆေးရန်
- pwd - print working directory - ယခုရောက်ရှိနေသော folder path အား စစ်ဆေးရန်
- ls - list - folder ထဲရှိ file list ကို ပြသရန် output ထုတ်ရန်
- cd - change directory - folder လမ်းကြောင်းပြောင်းရန်
- cd .. - change directory to backward (upper level of current directory) - လက်ရှိနေရာမှ အပြင်ပြန်ထွက်ရန်
- cd home - change directory to home (your home directory in Linux system) - home directory သို့ ပြန်သွားရန်
- cd ~ - change directory to home (your home directory in Linux system) - home directory သို့ ပြန်သွားရန်
- cd / - root (very root level of your drive on Linus) - Linux file system ရဲ့ root directory သို့သွားရန်
3. Creating folder and file
3.1. Creating folder
- mkdir - make directory (eg. mkdir folder_name, mkdir dir1 dir2 dir3)
- mkdir dir1 dir2 dir3 (create multiple folder by one command)
- mkdir -p dir4/dir5 (create parent and sub folder by one command) note: -p mean parent
- -p character means operation or switch (-p is shortcut for parent short word)
- --parent --verbose ( can be type command like --(double hyphen) for long word)
- mkdir "another folder" - use " character to create folder name with space.
3.2. Creating files using redirection
- ls > output.txt
- cat output.txt
- echo
- echo "This is a test"
- echo "This is a test 1" > text1.txt
- echo "This is a test 2" > text2.txt
- echo "This is a test 3" > text3.txt
- cat
- cat text1.txt text2.txt text3.txt
- cat text?.txt
- cat text*.txt
- cat t* > combined.txt
- cat combined.txt
- cat t* >> combined.txt
- echo "I've appended a line" >> combined.txt
- cat combined.txt
- less combined.txt
- echo "Lower Case" > a.txt
- echo "Upper Case" > A.TXT
- echo "Mixed Case" > A.txt