Linux Basic Command
What is Cd ?
cd ဆိုသည့် Command ကတော့ directory တစ်ခုမှတစ်ခုသို့ချိန်းချင်သည့်အခါသုံးသည့် Command ပဲဖြစ်ပါသည်။
$ cd (change the shell working directory)
What is Ls ?
ls ဆိုတာကတော့ ကိုယ်ရောက်နေသည့် directory အောက်မှာ ဘာတွေရှိလဲဆိုတာကို ကြည့်ချင်သည့် အခါသုံး သည့် Command ဖြစ်ပါသည်။
$ ls -l (use a long listing format)
$ ls -la (Hidden file)
$ ls -lh (human readable)
$ ls -ldh (Directory )
What is whoami & who ?
whoami ဆိုတာကတော့ မိမိရဲ့ username ကိုကြည့်သည့် command ဖြစ်ပါသည်။who ဆိုသည့် Command ကတော့ယခုလက်ရှိ Logged in ဝင်ထားသည့် user ကိုကြည့်သည့် Command ဖြစ်ပါသည်။wသည်လည်း logged on ဝင်သုံးနေသည့် user ကိုကြည့်သည့် Command ပဲဖြစ်ပါသည်။
$ whoami (username)
$ who (about users who are currently logged in)
$ w (Show who is logged on and what they are doing )
What is date Command ?
Date ဆိုသည့် Command ကတော့ date and time ကိုကြည့်ချင်ရင်အသုံးပြုသည့် Command ဖြစ်ပါသည်။
$ date (date and time)
What is Cal ?
Cal ဆိုတာကတော့ Terminal ထဲမှာ Calendar ကြည့်ချင်ရင်အသုံးပြုသည့် Command ပဲဖြစ်ပါသည်။
cal (calendar)
What is Tree ?
Tree ဆိုတာကတော့ Windows မှာလိုပဲ Directory နဲ့ file တွေကို tree Structure နဲ့ကြည့်ချင်ရင်သုံးသည့် Command ဖြစ်ပါသည်။
tree (list Directory and file as tree structure)
What is pwd ?
pwd ဆိုသည့် Command ကတော့ယခုလက်ရှိရောက်နေသည့် directory လမ်းကြောင်းကိုပြသည့် Command ဖြစ်ပါသည်။
pwd (current working directory)
What is Find Command ?
Find Command ကတော့မိမိရှာချင်သည့် file or directory name တွေကိုရိုက်ပြီးရှာလို့ရသည့် Command ပဲ ဖြစ်ပါသည်။find command ကိုသုံးပြီးတော့ ရှာချင်သည့်ဟာရဲ့ file,folder,name,creation date, modification date, owner and permissions တို့နှင့်ရှာလို့ရပါသည်။
ပထမဦးစွာ file ရဲ့ nameနဲ့ရှာနည်းကိုပြောပြပေးမှာဖြစ်ပါတယ်။
$ find test -name file8

နောက်ထပ် file format ရှာသည့်နည်းကတော့
$ find test -name *txt

ဒါဆိုရင် txt နဲ့စသည့် file တွေအကုန်လုံးကိုမြင်ရပြီဖြစ်ပါသည်။
အခုပြောပြမယ့် Option ကတော့ အဲ့file ကိုရှာပြီးတော့ delete လုပ်ချင်ရင်သုံးသည့်ပုံစံပဲဖြစ်ပါသည်။
$ find test/ -name file1.txt -exec rm -I {} \;

ပုံပါအတိုင်းကျွန်တော်က file1.txt ဆိုသည့် file လေးကို find command နဲ့ရှာပြီးတော့ delete လုပ်သောအခါ
rm : remove regular empty file ‘test/file1.txt’? ဆိုသည့်စာသားလေးပေါ်လာမည်ဖြစ်သည်။ ထိုအခါဖြတ် မယ်ဆိုတာသေချာရင် y ကိုနှိပ်ပြီး Enter လိုက်ပါ။ ဒါဆိုရင်တော့ ပုံပါအတိုင်း file1.txt ဆိုသည့် file မှာပြတ် သွားဖြစ်သည်။
ယခုထပ်ပြီးပြောပြမယ့် option ကတော့ empty ဖြစ်နေသည့် file နဲ့ directories တွေကိုရှာချင်ရင်သုံးတာပဲ ဖြစ်ပါတယ်။
$ find test -empty

အဲ့လိုရှာလိုက်တဲ့အခါ empty ဖြစ်နေသည့် file (or) folder တွေကိုပဲပြမည်ဖြစ်ပါသည်။ပုံပါအတိုင်း file5.txt ဆိုသည့် file လေးက အထဲမှာစာရေးထားသည့်အတွက် ရှာသည့်အခါမှာမပါတော့တာဖြစ်ပါတယ်။ ဒီတစ်ခါမှာတော့ Permission နဲ့ ရှာတာကိုပြောပြမှာဖြစ်ပါတယ်။
$ find test/ -perm 750

Permission နဲ့ရှာလိုက်သည့်အခါ ပုံပါအတိုင်း 750 ဖြစ်နေသည့် permission ပေးထားသည့် file ကိုသာ မြင်တွေ့ရမည်ဖြစ်သည်။ဒီနေရာမှာတော့ permission 750 ဆိုတာကိုမသိသေးရင်လဲဒီတိုင်းပဲဆက်မှတ်သွား ပါ။Permission အခန်းမှာ အသေးစိတ်ရှင်းပြထားပါသည်။
နောက်ထပ်မိမိရှာချင်သည့် multiple file ထဲမှာ ရှိသည့် စာလုံးတူနေတာတွေကို ရှာချင်ရင်သုံးသည့် options ပဲဖြစ်ပါတယ်။
$ find test/ -type f -name *.txt -exec grep ‘hello’ {} \;
သဘောကတော့ test ဆိုသည့် folder ထဲက ရှိသမျှ .txt နဲ့ဆုံးသည့် file တွေထဲကနေ hello ဆိုသည့်မိမိ ကြည့်ချင်သည့် စာ သားပါသည့် ဟာကိုထုတ်ကြည့်ချင်ရင်အသုံးပြုသည့် options ပဲဖြစ်ပါသည်။

What is mv command?
mv ဆိုသည့် command ကတော့ နှစ်မျိုးသုံးလို့ရပါသည်။ file(or)directory တွေကို move လုပ်ချင်သည့်အခါ မှာသုံးလို့ရသလို ,rename လုပ်ချင်သည့်အခါမှာလဲသုံးလို့ရပါသည်။
$ mv file1.txt test1
$ mv file1.txt hello.txt

Echo
echo ဆိုတာကတော့ text/string တွေကို output အနေနဲ့ပြန်ထုတ်ပြသည့် command ဖြစ်ပါသည်။ဥပမာ test.txt ဆိုသည့် file ဆောက်ပြီးအဲ့ထဲမှာစာပါတစ်ခါထဲရေးချင်ရင် အောက်ပါအတိုင်းအသုံးပြုလို့ရသည်ပဲ ဖြစ်ပါသည်။
$ echo “haha” > test.txt

Head
Head ဆိုသည့် command ကတော့ အပေါ်ဆုံးက လိုင်း 10လိုင်းမှာရှိသည့် စာသားတွေကိုကြည့်ချင်ရင်အသုံး ပြုသည့် command ဖြစ်ပါသည်။
$ head /etc/passwd (first 10 lines of each file)

Tail
Tail ဆိုသည့် command ကတော့ အောက်ဆုံးလိုင်း 10လိုင်းရဲ့စာတွေကိုကြည့်ချင်ရင်အသုံးပြုသည့် command ပဲဖြစ်ပါသည်။
$ tail /etc/passwd (last 10 lines of each file)

Cat
Cat command ကတော့ file အတွင်းထဲမှာရှိနေသည့် အကြောင်းအရာတွေကိုကြည့်ချင်သည့်အခါ အသုံးပြု သည့် command ပဲဖြစ်ပါသည်။
cat file1.txt (read standard input)

More
More ဆိုတာကတော့ text file တွေကို scroll up and down လုပ်ပြီး Terminal ထဲမှာကြည့်ချင်ရင် အသုံးပြု သည့် command ပဲ ဖြစ်ပါသည်။
$ more /etc/passwd

Less
Less command သည်လည်း file ထဲမှာပါသည့်အကြောင်းအရာတွေကို up and down လုပ်ပြီးကြည့်လို့ရ သည့် command ပဲဖြစ်ပါသည်။
$ less /etc/passwd

Uname
မိမိအသုံးပြုနေသည့် Linux Version,Kernel,Operating System စသည်တို့ကိုကြည့်ချင်ရင်အသုံးပြုရသည့် command ပဲဖြစ်ပါသည်။
uname -s (kernel Name)
uname -n (node Name)
uname -r (kernel release)
uname -v (kernel version)
uname -o (operating system)
uname -m, -p (32 bit=i386,i686) (64 bit=x64 x6_x64 )
Grep Command
Grep command ကတော့ file ထဲမှာရှိသည့်စာသားများထဲမှ မိမိကြည့်ချင်သည့်စာသားကိုသာ ဆွဲထုတ်ကြည့် ချင်သည့်အခါတွင်အသုံးပြုသည့် Command ဖြစ်ပါသည်။Grep ကိုcommand အဖြစ်နဲ့ သုံးနိုင်သလို တခြား command များနှင့်လည်းတွဲသုံးလို့ရပါသေးသည်။

Df Command
Hard Disk ရဲ့ information တွေကိုကြည့်သည့် command ဖြစ်ပါတယ်။df --help ကိုသုံးပြီးတော့options တွေကိုဖတ်ပြီးအသုံးပြုနိုင်ပါသည်။df -k ကတော့ byte နဲ့ပြတာဖြစ်ပြီး df -h ကတော့ human readable format လူနားလည်သည့် ပုံစံနဲ့ပြတာပဲဖြစ်ပါသည်။

Top Command
ကျွန်တော်တို့အသုံးပြုနေသည့် Process တွေရဲ့ resource တွေကိုအသုံးပြုထားသည့်ပမာဏအလိုက်ကြည့် လို့ရသည့် command ဖြစ်ပါသည်။

Ps command
မိမိတို့အသုံးပြုနေသည့် process တွေကိုကြည့်သည့်command ပဲဖြစ်ပါတယ်။process တွေကိုကြည့် သည့်အခါ အဲ့ process တွေမှာ id ဆိုတာရှိပါတယ်။အသုံးပြုနေသည့် process တွေကိုရပ်ချင်သည့်အခါ process id ကို kill command ဖြင့်ရပ်ပစ်နိုင်ပါတယ်။Process ကြည့်ချင်ရင်တော့

Process ကို ရပ်ပစ်ချင်ရင်တော့ process id ဖြစ်သည့် PID ကိုနံပါတ်ကို kill command ဖြင့်ရပ်တန့်ပစ်လို့ရပါ သည်။
$ kill -9 2443
Ifconfig Command
ifconfig ဆိုတာကတော့ Windows ရဲ့ ipconfig Command လိုပဲ ipစစ်သည့် command ဖြစ်ပါသည်။

Ping ,traceroute
Ping Command ကတော့ windows မှာလိုပဲ network စက်တစ်ခုနှင့်တစ်ခု မိမမိစစ်သည့် command ပဲဖြစ်ပါ သည်။ဒီမှာတော့ ping 192.168.1.1 ဆိုပြီး ping ရင် Windows မှာလို 4 ခါနဲ့မရပ်နဲ့ ဆက်တိုက်သွားနေမည် ဖြစ်သည်။ အရေအတွက်နဲ့ ping ချင်ပါက ping 192.168.1.1 -c2 ဆိုပြီး ထည့်ပြီးရေးနိုင်ပါသည်။ဒါဆိုရင် တော့ 2 ခေါက်ပဲ ping မည်ဖြစ်သည်။
Traceroute Command ကတော့ ဥပမာ google ကိုဘယ် gateway ကနေဖြတ်သွားလဲဆိုတာကို trace လိုက် သည့် Command ပဲဖြစ်ပါတယ်။

Dig Command
Dig Command ကတော့ windows က nslookup လို ကြည့်ချင်ရင်အသုံးပြုသည့် command ပဲဖြစ်ပါတယ်။

What is , Where is Command
Command တွေရဲ့တည်နေရာနှင့် ဘာလုပ်သည့် command လဲဆိုတာကိုကြည့်ချင်ရင် အသုံးပြုပါတယ်။

Locate Command
Locate Command File တွေရဲ့တည်နေရာကိုရှာချင်ရင်အသုံးပြုသည့် command ပဲဖြစ်ပါသည်။

Alias Command
Command တွေကိုအတိုကောက်အနေနဲ့အသုံးပြုတာပဲဖြစ်ဖြစ် မိမိမှတ်မိနေမည့်စာသားနှင့်ပြောင်းချင်သည့် အခါမျိုးပဲဖြစ်ဖြစ်အသုံးပြုနိုင်ပါသည်။

Free
Free Command ကတော့ Memory နဲ့ Swap Free,used,Total တို့ကိုကြည့်ချင်ရင်အသုံးပြုသည့် Command ပဲဖြစ်ပါသည်။

Du Command
Du ဆိုသည့် Command ကတော့ File/Folder တွေရဲ့ disk usuage တွေကို သိချင်ရင်ကြည့်နိုင်သည့် Command ပဲဖြစ်ပါသည်။
du -h (file or directory size)

SU Command
Su Command ကဘာလဲဆိုတော့ su(Switch User) user account ပြောင်းချင်ရင်သုံးသည့် Command ဖြစ်ပါ သည်။ ဥပမာ root account (or) တခြား user account တွေကို Terminal ပေါ်မှာချိန်းပြီးအသုံးပြုချင်ရင် သုံးပါသည်။ root acc ကိုချိန်းချင်ရင်တော့ su ရိုက်ပြီး password ထည့်လိုက်ရင်ချိန်းသွားမည်ဖြစ်ပြီး တခြား user account တွေဆိုရင်တော့ su user1 ဆိုပြီး username ပါရိုက်ထည့်ပေးရမည်ဖြစ်သည်။
$ su , su user1
Sudo Command
Sudo ရဲ့အဓိပ္ပါယ်ကတော့ Superuser do ဖြစ်ပြီးတော့ root permission နဲ့မှ access လုပ်ရမည့် ဟာတွေကို
Sudo ခံပြီးအသုံးပြုရသည်။ ဥပမာ User Account ကနေပဲ ssh service ကို start ,stop လုပ်ချင်ရင် sudo Command ကိုအသုံးပြုပီးတော့လုပ်ဆောင်ရတာပဲဖြစ်ပါသည်။
$ sudo systemctl start sshd
Which Command
Which Command သည် locate Command နှင့်အတူတူပင်ဖြစ်ပြီး file တွေရဲ့ တည်နေရာကိုရှာချင်ရင် အသုံး ပြုပါသည်။
$ which ls

Dmidecode Command
Dmidecode Command ကတော့ system information တွေကို အသေးစိတ်သိချင်ရင်ကြည့်နိုင်သည့် command ပဲဖြစ်ပါသည်။
$ sudo dmidecode (system info detail)
$ sudo dmidecode | grep -A4 "Base Board Information"
Uptime Command
မိမိ Server ရဲ့ uptime ကြည့်ချင်ရင်အသုံးပြုသည့် Command ဖြစ်ပါသည်။
$ uptime
$ uptime -p (Check uptime of machine)

Lastlog
Lastlog Command ကတော့ user တွေရဲ့ နောက်ဆုံး login ဝင်ခဲ့သည့် time ကို စစ်ဆေးလို့ရသည့် command ဖြစ်ပါသည်။
$ lastlog (Check the last logging user and time)

History Command
History Command ကတော့ Terminal ထဲမှာ ရိုက်ခဲ့သည့် Command တွေရဲ့ history ကိုပြန်ကြည့် Command ဖြစ်ပါသည်။
history (Display last commands in history)
history -c (Clear History)
history -d 20 (Delete history number)
set +o history (Disable History)
set -o history (Enable History)
Nmcli Networking ,Nmcli Connection
ဒီ Command ကတော့ မိမိရဲ့စက်ကို enabled/disabled , Network Card ရဲ့ Name ,UUID,Type,Device တို့ကိုစစ်ဆေးသည့် Command ဖြစ်ပါသည်။
nmcli networking ,nmcli connection

Last updated
Was this helpful?