LESSON(2) Basic Commands in Linux and Windows

2.1.Introduction and Objectives

ဒီ lesson မှာ window နဲ့ linux OS တွေမှာ ရှိတဲ့ commands တွေနဲ့ Tools တွေကို ရင်းနှီးသွားအောင် မိတ်ဆက်ပေး သွားမှာပါ။ ဒီ lesson ဆုံးတာနဲ့ ခင်ဗျားဟာ အောက်က အရာတွေကို သိပြီးဖြစ်သွားမှာပါ။

  • General Windows and Linux commands
  • Basic network commands and tools
    • ping
    • tracert
    • netstat
    • ipconfig
    • route
2.2.System Operation:WINDOWS

Start => Run => type "cmd" => OK
WINDOWS ရဲ့ Commands and tools တွေကတော့ အောက်ပါအတိုင်းဖြစ်ပါတယ်။

Commands
datesystem ရဲ့ date ကိုပြပါတယ်(သို့)သတ်မှတ်လို့ရပါတယ်။
timesystem ရဲ့ time ကိုပြပါတယ်(သို့)သတ်မှတ်လို့ရပါတယ်။
verလက်ရှိသုံးနေတဲံ MS-DOS version ကိုပြပါတယ်။
dirပေးထားတဲ့ directory(folder)တစ်ခုအတွင်းမှာ ရှိတဲ့ subdirectories(subfolder) (သို့) files တွေရဲ့ list ကိုပြပါတယ်။
clsClear the screen
mkdir,md directorydirectory ဆိုတဲ့ နာမည်နဲ့ folder(directory) အသစ်တစ်ခုဖန်တီးပေးပါတယ်။ ဥပမာ။ md tools
chdir, cd directoryလက်ရှိ folder(directory)နာမည်ကို ဖော်ပြခြင်း(သို့)"directory" သို့ပြောင်းလဲပေးပါတယ်။ ဥပမာ။ cd tools
rmdir, rd directory"directory" ဆိုတဲ့ folder(directory)ကိုဖျက်ပါတယ်။ ဥပမာ။ rd tools
tree directoryပေးထားတဲ့ folder structure ကို text-graphic format နဲ့ ပြပါတယ်။ ဥပမာ။ tree c:\tools
chkdskCheck a disk and show a status report
memလက်ရှိအသုံးပြုနေတဲ့ memory amount နဲ့ free amount ကိုပြပေးပါတယ်။
rename, ren source destfile နာမည်ကိုပြောင်းပေးပါတယ်။ ဥပမာ။ ren oldname newname
copy source destCopy one or more files to another location ဥပမာ။ copy c:\tools\myfile.txt c:\temp
move source destfiles များကိုရွှေ့ပေးပါတယ်။ ဥပမာ။move c:\tools c:\temp
type filetext file မှာ စာရေးပေးပါတယ်။ဥပမာ။ type c:\tools\myfile.txt
more fileDisplay the information screen by screen ဥပမာ။ more c:\tools\myfile.txt
delete,del filenamedelete one or more files ဥပမာ။ del c:\tools\myfile.txt

Tools
ping hostPing command ကတော့ ICMP(Internet Control Message Protocol) လေးကို အသုံးပြုပြီး “packets” လေးတွေကို "host" ဆိုတဲ့ကွန်ပြူတာကို ပို့လွှတ်တာဖြစ်ပါတယ်။ အဲဒီလိုနဲ့ ဒီ command က လက်ရှိကွန်ပြူတာဟာ သူတည်ရှိနေတဲ့ network ထဲမှာ accessible ဖြစ်မဖြစ်ကို စမ်းသပ်ပေးပါတယ်။ ထပ်မံပြီး ဒီ command ဟာ အဲဒီ answered packets တွေအားလုံးရဲ့ summary နဲ့ response time တွေကိုပါ တပါတည်း ဖော်ပြပေးပါတယ်။ host ဆိုတဲ့ စာသားနေရာမှာ IP address ဒါမှမဟုတ် စက်နာမည်ကို ရေးပေးရပါမယ်။ ဥပမာ။ ping www.google.com
Ping 193.146.85.2
ဒီ command ရဲ့ တခြား options လေးတွေကတော့
-n N: send N packets
-t :သတ်မှတ်ထားတဲ့ host တစ်ခုကို မရပ်ခိုင်း မချင်း ping နေပါတယ်။
tracert hostTracert host ဒီ command ကတော့ “host” ဆီကို ရောက်သွားဖို့ အတွက် လွှတ်လိုက်တဲ့ packet လေးရဲ့ လမ်းကြောင်းကို ဖော်ပြပါတယ်။ command “tracert” ဟာ Trace route ရဲ့ အတိုကောက်ဖြစ်ပြီး user ရဲ့ လက်ရှိ computer ကနေပြီးတော့ သတ်မှတ်ပေးလိုက်တဲ့ “host” ဆိုတဲ့နေရာကို ရောက်အောင်သွားတဲ့ လမ်းကြောင်းကို ပြပေးပါတယ်။နောက်ပြီး အဲဒီ packet လေးသွားတဲ့ လမ်းတလျောက်ကြာချိန်ကိုလည်း ဖော်ပြပေးပါတယ်။ တခါတရံမှာ အဲဒီ လမ်းကြောင်းတလျောက်မှာ ရှိတဲ့ စက်များရဲ့ အမည်များက စိတ်ဝင်စားဖို့ကောင်းပါတယ်။
ဥပမာ။ tracert www.google.com
Tracert 193.146.85.2
ဒီ command ရဲ့ တခြား option လေးတွေကတော့ -h N: အများဆုံး ဖြတ်သွားရမယ့် အရေအတွက် N
-d : machines နာမည်ကို မဖော်ပြရန်။
ipconfigIpconfig ဒီ command ကတော့ လက်ရှိ computer မှာ သုံးနေတဲ့ active interfaces(Ethernet,ppp,etc) ရဲ့ information ကို ဖော်ပြပေးပါတယ်။ ဒီ command ရဲ့ တခြား option လေးတွေကတော့
/all : အားလုံးကို details ပြပါ။
/renew name: automatic configuration with DHCP ကို အသုံးပြုပြီး “name” ဆိုတဲ့ ကွန်နက်ရှင်းကို ပြန်ဆက်သွယ်ပါတယ်။
/release name : automatic configuration with DHCP ကိုသုံးထားတဲ့ connection အားလုံးကို deactivates လုပ်ပါတယ်။
route printRouting table ကို ဖော်ပြပေးပါတယ်။ command “route” ဟာ routes တွေကိုသတ်မှတ်ပေးတယ်။ routes တွေကိုဖျက်ပေးတယ်။ ဒါမှမဟုတ် route တွေရဲ့ အခြေအနေကို ဖော်ပြပေးတယ်။သူ့ရဲ့ တခြား option လေးတွေကတော့
Print : to show the list of routes
Delete : to delete a route
Add : to add a route
netstatRemote machines နဲ့ သက်ဆိုင်တဲ့ connection တွေ၊ network status တွေရဲ့ information တွေကို ဖော်ပြပေးပါတယ်။ သက်ဆိုင်တဲ့ တခြား option လေးတွေကတော့
-a : To sample all the connections and listening ports
-n : To display addresses and port number in numeric form
-e : To sample Ethernet statistics
ဥပမာ။ netstat -an

2.3.System Operation: Linux

ဒီအကြောင်းကိုတော့ သိပ်မသိလို့ မရေးတော့ပါဘူး။ အင်္ဂလိပ်လိုပဲ တင်ပေးလိုက်ပါတယ်။
Just as in Windows, if you are using Linux, a great majority of the commands that you will use are executed from a console emulation window. Therefore, we will next learn how to open a console window in Linux.
2.3.1 How to open a console window
To issue the following commands, it is necessary to open a console window:
1 - To go to the START APPLICATION button
2 - Select “Run Command”
3 - Enter “konsole”
4 - A window similar to the following one will appear:
5 - Now the commands and tools listed below can be entered.

Commands
pwdDisplay the name of the current directory
hostnameDisplay the name of the local host (the computer which you are currently using)
finger user Display information on the user “user” Example: finger root
lsList the content of the directories Example: ls -la
cd directoryChange from current directory to “directory”. If no directory name is specified it changes to the home directory,
Example: For the login name “mylogin” the command
$cd
changes the directory to /home/mylogin
Example:
$cd -
changes to the last visited directory
Example:
$cd /tmp
changes to the “tmp” directory
cp source dest Copy files. Copy the file “source” to the file “dest”.
Example: cp /etc/passwd /tmp
rm fileDelete files. Only the owner of the file (or root) can delete it. Example: rm myfile
mv source dest Move or rename files and directories.
Example: mv oldname newname
mkdir directory Make a directory with the name “directory”.
Example: mkdir tools
rmdir directory Delete the directory with the name “directory” if it is empty.
Example: rmdir tools
find / -name file Find a file with the name “file” beginning the search in the root directory
Example: find / -name myfile
echo string Write the string “string” in the standard output
Example: echo hello
command > file Redirect the normal screen output of the command “command” to the file “file”
Example: ls > myls
command >> fileRedirect the normal screen output of the command “command” to the file “file”. If the file already exists, it appends the output to the end of the file.
Example: ls >> myls
man command Show the pages of the online manual about “command”
Example: man ls
Note: The words in italics are not commands and must be replaced by the desired values.
For additional information on the use of these commands and tools, type in "command -help" or "man command" in the console window.
For example, for additional information on the “ls” command, type in either of these two possibilities:
1) ls –-help
2) man ls

Tools(Please see the Windows section for details on these tools.)
ping host Verify the contact with the machine “host”
Example: ping www.google.com
traceroute host Show the route that the packets follow to reach the machine “host”.
Example: tracert www.google.com
ifconfig Display information on the active interfaces (ethernet, ppp, etc.)
route Display the routing table
netstat Display information on the status of the network
Example: netstat -an


2.4.Exercises in Windows

2.5.1 Exercises in Windows
1. Go to a MS-DOS window.
2. Identify the version of MS-DOS that you are using. What version have you detected? What
command have you used?.
3. Identify the date and time of the system. If they are incorrect, modify them so that they are
correct. What command have you used?
4. Identify all the directories and files that are in “c:\”. What command have you used?
5. Create the directory c:\hhs\lesson0. Copy in this directory all the files with the extension
“.sys” that are in “c:\”. What files have you found? What commands have you used?
6. Identify the IP address of your host. What command have you used? What IP address do
you have?
7. Trace the route to “www.google.com”. Identify IPs of the intermediate routers.

No Response to "LESSON(2) Basic Commands in Linux and Windows"

Post a Comment

powered by Blogger