Alias On Ubuntu
Ko Ko Ye
Founder
1 min read

Ubuntu users တွေအတွက် Terminal သုံးတဲ့အခါမှာ အချိန် ကုန်သက်သာစေမယ့် နည်းလမ်းကောင်းတစ်ခုပေးချင်ပါတယ်။
terminal မှာ alias သုံးနည်းလေးဘဲဖြစ်ပါတယ်။
ကိုယ် ရေးနေကြ command အရှည်ကြီးတွေ နေ့စဉ်နဲ့အမျှ မရိုက်ချင်လျှင် alias cmd လေးနဲ့ ချုပ်ထားလို့ရပါတယ်။
ဥပမာ
သင့်ရဲ့ ubuntu os ကို update သို့မဟုတ် upgrade လုပ်ချင်လျှင်
sudo apt-get update;sudo apt-get upgrade;sudo apt-get dist-upgrade
ဆိုပြီး အရှည် ကြီးရိုက်ရပါမယ်။
အဲလို မရိုက်ဘဲ alias ကိုသုံးပြီး တိုအောင်လုပ်ထားလို့ရပါတယ်။
alias update='sudo apt-get update;sudo apt-get upgrade;sudo apt-get dist-upgrade'
အပေါ်က လို သင့်ရဲ့ terminalမှာ ရိုက်လိုက်ပါ။
ပြီးရင် နောက်တခါရိုက်ချင်လျှင် အကုန် ရိုက်စရာ မလိုတော့ပါဘူး။ aliasပေးထားတဲ့ updateလို့ ရိုက်တာနဲ့ အဲ cmdတွေ အကုန် အလုပ်လုပ်သွားမှာပါ။
အလုပ် လုပ်တဲ့ အခါမှ တစ်နေ့အတွင်း အကြိမ်ဖန်များစွာ ရိုက်မယ့် cmdတွေ ကို ပေးထားသင့်ပါတယ်။
အဲလို ဘဲ ပေးထားမည်ဆိုပါက terminal session တစ်ခုအတွင်းဘဲ အလုပ် လုပ်မှာပါ။
တကယ်လို့ os bootတက်လာတဲ့ အချိန်တိုင်း alias ကို အလုပ် လုပ်စေချင်ရင် source configuration file ထဲမှာ configure လုပ်ထားဖို့လိုပါမယ်။
အဲလို လုပ်ဖို့ကလည်း မခက်ပါဘူး။
nano,vim,gedit စတဲ့ text editor ကြိုက်ရာတစ်ခုခုနဲ့ .bashrc file ထဲကို alias cmdကို configure လုပ်ပေးရမှပါ။
sudo nano ~/.bashrc
ဆိုပြီး ဝင်လိုက်ပါ။
ပြီးရင် မိမိလုပ်မယ့် alias cmd ကို အဲfile ထဲ ကတစ်နေနေရာမှာ အမှတ်အသားလုပ်ပြီး ရေးလိုက်ပါ။
ဥပမာ touchscreen ကိုပိတ်မည့် cmd က
xinput disable 11
ရိုက်မယ့်cmd ကို alias လုပ်ချင်ရင်
alias touchoff='xinput disable 11'
ဆိုပြီး အဲ.bashrc fileထဲမှာရေးလိုက်ပါ ပြီးလျှင် saveပါ။
ပြီးလျှင် source .bashrc ဆိုပြီး file ကို update လုပ်လိုက်ပါ။
အဲတာတွေပြီးရင်တော့ သင်တို့ရဲ့အလုပ်တွေ ကို မြန်မြန်ဆန်ဆန်လုပ်နိုင်ပါပြီ။
ကျေးဇူးတင်ပါတယ်။
Image from: https://www.tekbyte.net/why-bash-aliases-are-awesome/
Related posts
The Call for Participation is now open for Ubuntu 22.04 Release Party
To celebrate the new release of the popular free and open source GNU/Linux distribution Ubuntu 22.04, we are going to hold a release party. The event will take place on the 1st of…
1 min read
Meet ya Linux Foolish Guys
We had facing a lot of problem. Internet access, Electronic power, Mental and Physical issues …. all about is because of Military Coup. Sometimes feeling guilty, we are selfish ?…
1 min read
Ubuntu 21.10 Install Demo
Ubuntu 21.10 Is released. https://releases.ubuntu.com/21.10/ https://youtu.be/pQBL0dDYWxI Estimate: 10 Min Play Speed: x4
1 min read



