ဒီ lesson မွာ window နဲ႔ linux OS ေတြမွာ ရွိတဲ့ commands ေတြနဲ႔ Tools ေတြကုိ ရင္းႏွီးသြားေအာင္ မိတ္ဆက္ေပး သြားမွာပါ။ ဒီ lesson ဆံုးတာနဲ႔ ခင္ဗ်ားဟာ ေအာက္က အရာေတြကုိ သိျပီးျဖစ္သြားမွာပါ။
- General Windows and Linux commands
- Basic network commands and tools
- ping
- tracert
- netstat
- ipconfig
- route
Start => Run => type "cmd" => OK
WINDOWS ရဲ့ Commands and tools ေတြကေတာ့ ေအာက္ပါအတုိင္းျဖစ္ပါတယ္။
Commands
| date | system ရဲ့ date ကုိျပပါတယ္(သုိ႔)သတ္မွတ္လုိ႔ရပါတယ္။ |
| time | system ရဲ့ time ကုိျပပါတယ္(သုိ႔)သတ္မွတ္လုိ႔ရပါတယ္။ |
| ver | လက္ရွိသံုးေနတဲံ MS-DOS version ကုိျပပါတယ္။ |
| dir | ေပးထားတဲ့ directory(folder)တစ္ခုအတြင္းမွာ ရွိတဲ့ subdirectories(subfolder) (သုိ႔) files ေတြရဲ့ list ကုိျပပါတယ္။ |
| cls | Clear the screen |
| mkdir,md directory | directory ဆုိတဲ့ နာမည္နဲ႔ 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 |
| chkdsk | Check a disk and show a status report |
| mem | လက္ရွိအသံုးျပဳေနတဲ့ memory amount နဲ႔ free amount ကိုျပေပးပါတယ္။ |
| rename, ren source dest | file နာမည္ကုိေျပာင္းေပးပါတယ္။ ဥပမာ။ ren oldname newname |
| copy source dest | Copy one or more files to another location ဥပမာ။ copy c:\tools\myfile.txt c:\temp |
| move source dest | files မ်ားကုိေရႊ႕ေပးပါတယ္။ ဥပမာ။move c:\tools c:\temp |
| type file | text file မွာ စာေရးေပးပါတယ္။ဥပမာ။ type c:\tools\myfile.txt |
| more file | Display the information screen by screen ဥပမာ။ more c:\tools\myfile.txt |
| delete,del filename | delete one or more files ဥပမာ။ del c:\tools\myfile.txt |
Tools
| ping host | Ping 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 host | Tracert 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 နာမည္ကုိ မေဖာ္ျပရန္။ |
| ipconfig | Ipconfig ဒီ 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 print | Routing table ကုိ ေဖာ္ျပေပးပါတယ္။ command “route” ဟာ routes ေတြကုိသတ္မွတ္ေပးတယ္။ routes ေတြကုိဖ်က္ေပးတယ္။ ဒါမွမဟုတ္ route ေတြရဲ့ အေျခအေနကုိ ေဖာ္ျပေပးတယ္။သူ႔ရဲ့ တျခား option ေလးေတြကေတာ့ Print : to show the list of routes Delete : to delete a route Add : to add a route |
| netstat | Remote 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
| pwd | Display the name of the current directory |
| hostname | Display the name of the local host (the computer which you are currently using) |
| finger user | Display information on the user “user” Example: finger root |
| ls | List the content of the directories Example: ls -la |
| cd directory | Change 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 file | Delete 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 >> file | Redirect 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 |
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.