linux command

scp – Linux Command คำสั่งคัดลอก file ข้อมูลแบบเข้ารหัสความปลอดภัย

scp Linux Command – scp เป็นคำสั่งคัดลอก file ข้อมูลแบบเข้ารหัสความปลอดภัย ด้วยพื้นฐานคำสั่ง ssh   คำสั่ง 1. คัดลอก file จาก local host ไปยัง remote host scp <file> <user>@<IP/Domain>:<file> scp myfile.txt staff@saixiii.com:myfile.txt   2. คัดลอก file ใน directory ทั้งหมดจาก remote host มายัง local host scp <user>@<IP/Domain>:<directory>:/* . scp staff@saixiii.com:/home/saixiii/* .   3. คัดลอก directory จาก remote host มายัง local host scp -r…

Read More
linux command

ssh – Linux Command คำสั่งเชื่อมต่อ shell server แบบเข้ารหัสความปลอดภัย

ssh Linux Command – ssh เป็นคำสั่งเชื่อมต่อจาก Client ไปยัง Server เพื่อเข้าสู่ Shell พร้อมทั้งมีการเข้ารหัสความปลอดภัย หรือ secure shell   คำสั่ง ssh <user>@<IP/Domain> $ ssh staff@example.com staff@example.com’s password: Last login: Mon May 15 14:42:35 2017 from 172.16.12.16 [staff@example.com ~]$   โครงสร้างคำสั่ง  ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file]…

Read More
linux command

telnet – Linux Command คำสั่งโปรโตรคอลเชื่อมต่อสื่อสารด้วยข้อมูลตัวอักษร

telnet Linux Command – telnet เป็นโปรโตรคอลเชื่อมต่อสื่อสารด้วยข้อมูลตัวอักษร   คำสั่ง telnet <IP/Domain> <Port> root$root telnet localhost 22 Trying ::1… Connected to localhost. Escape character is ‘^]’. SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 root@root:~$ telnet google.com 80 Trying 216.58.196.206… Connected to google.com. Escape character is ‘^]’.   โครงสร้างคำสั่ง telnet [-468ELadr] [-S tos] [-b address] [-e escapechar] [-l user] [-n tracefile] [host [port]]…

Read More
linux command

nano – Linux Command คำสั่งในการสร้างหรือแก้ไข file ข้อมูล text

nano Linux Command – nano ใช้ในการสร้างหรือแก้ไข file ข้อมูล text   คำสั่ง 1. สร้าง file nano <file> $ nano [file-name]   2. Save file ใช้ short cut Ctl+o  จากนั้นจะให้ confirm ชื่อ file และกด enter   3. การ Cut หรือ Paste ข้อมูล วาง cursor และลากเลือกคำที่ต้องการ cut และ กด Ctl+k  จากนั้นวาง Cursor ที่ต้องการ paste ข้อมูล และกด Ctl+u  …

Read More
linux command

vi – Linux Command คำสั่งในการสร้างหรือแก้ไข file ข้อมูล text

vi Linux Command – vi ใช้ในการสร้างหรือแก้ไข file ข้อมูล text   คำสั่ง 1. สร้าง file vi <filename> $ vi test หลังจากเข้าสู่หน้า vi prompt แล้วจะจะพบว่าเราไม่สามาถพิมพ์ข้อมูลลงไปได้โดยตรง จะต้องเลือกคำสั่งก่อนว่าจะทำอะไรกับ file ข้อมูล เมื่อเลือกคำสั่งแล้วถ้าจะกลับสู่ vi prompt ใหม่ก็ให้กด ESC   2. คำสั่งจัดการ file :w   save file :wq   save file และออกจาก vi :q   ออกจาก vi ถ้าไม่มีการแก้ไขข้อมูล :q!   ออกจาก vi โดยไม่สนว่าข้อมูลมีการแก้ไขหรือไม่…

Read More
shell

Shell คืออะไร Unix Shell หรือ Linux Shell คือ โปรแกรมรับคำสั่งให้กับ Kernel

Shell คืออะไร ผู้ทีเริ่มใช้งาน Unix หรือ Linux อาจจะได้ยินคำว่า shell กันบ่อยๆ และจริงๆ shell คืออะไร หละ ?  ตามความหมายแล้วมันคือตัวแปลงคำสั่งที่ช่วยให้ผู้ใช้งานสามารถเข้าถึงระบบ operating system มีด้วยกัน 2 แบบคือ CLI – Command line interface รับคำสั่งโดยข้อมูล text และแสดงผลในรูปแบบ text เช่นกัน GUI – Graphical user interface รับคำสั่งโดยอาศัย mouse และ รูปบนจอ monitor ขึ้นอยู่กับระบบ computer ที่ใช้งานว่าออกแบบมาสำหรับงานประเภทไหน โดยคำว่า “shell” มีที่มาจากการที่มันทำหน้าที่เป็น layer ครอบคลุมการทำงานของ Kernel อีกที   ส่วนมากแล้ว ตัว shell ไม่ได้มีการเชื่อมต่อโดยตรงภายใต้ Kernel…

Read More
linux kernel

Kernel คืออะไร Kernel คือ ส่วนกลางควบคุมการทำงานทุกอย่างบน OS

Kernel คืออะไร สำหรับผู้ที่เริ่มใช้งาน Linux อาจจะมีคำถามกับคำว่า Kernel คืออะไร จริงๆแล้ว Kernel คือ โปรแกรมที่เป็นศูนย์กลางในระบบ computer ทำหน้าที่ควบคุมการทำงานตั้งแต่เริ่ม boot server รวมถึงการ start/stop program และ input/output จาก software ทั้งหมด คอยจัดการทรัยากรต่างๆ หรือ hardware เช่น keyboard, monitor, printer, speaker โดย Kernel ทำหน้าที่เชื่อมการทำงานระหว่าง software และ hardware เข้าด้วยกันนั่นเอง ส่วนที่เป็น code สำคัญของ Kernel จะถูก load เข้าส่วน memory ที่จองไว้ให้เฉพาะ เพื่อป้องกันการเขียนทับจาก application อื่น การเชื่อมต่อของ Kernel เป็นระดับต่ำสุดที่เกียวข้องกับ hardware เมื่อมีการ…

Read More
linux command

iptables – Linux Command คำสั่งจัดการกรอง ip port ที่เข้ามาใช้งาน

iptables Linux Command – iptables ใช้ในการจัดการกรอง ip port ที่เข้ามาใช้งาน   คำสั่ง 1. แสดงข้อมูลการกรอง conncetion $ iptables -L INPUT -n –line-numbers   2. ลบ iptables rule $ iptables -D INPUT <line-number>   3. เพิ่ม iptables rule $ iptables -I INPUT 2 -s 202.54.1.2 -j DROP   โครงสร้างคำสั่ง  iptables [-t table] {-A|-C|-D} chain rule-specification ip6tables [-t table] {-A|-C|-D} chain…

Read More
linux command

netstat – Linux Command คำสั่งแสดงสถานะ network connection ทั้งหมด

netstat Linux Command – netstat ใช้ในการแสดงสถานะ network connection ทั้งหมด   คำสั่ง 1. แสดงข้อมูลสถานะ network netstat $ netstat Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 216 xxx.com:ssh cm-134-196-90-62.:49639 ESTABLISHED tcp6 0 0 xxx.com:https cm-134-196-90-62.:50393 FIN_WAIT2 tcp6 0 0 xxx.com:https cm-134-196-90-62.:50389 TIME_WAIT tcp6 0 0 localhost:39280 localhost:2181 ESTABLISHED Active UNIX…

Read More
linux command

ifconfig – Linux Command คำสั่งแสดงข้อมูลและเปลี่ยนค่า interface server

ifconfig Linux Command – ifconfig ใช้ในการแสดงข้อมูลและเปลี่ยนค่า interface server   คำสั่ง 1. แสดงข้อมูล interface ทั้งหมด ifconfig -a $ ifconfig -a enp2s0 Link encap:Ethernet HWaddr 00:1e:c9:54:6b:29 inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::21e:c9ff:fe54:6b29/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2244525 errors:0 dropped:2550 overruns:0 frame:0 TX packets:2996535 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:355746122 (355.7 MB)…

Read More