Common Linux commands (6)-Network Communication commands

Source: Internet
Author: User
Common Linux commands (6) -- Network Communication commands 1. command name: writewww.2cto.com execution permission: all users function description: send information to another user, with CTRL + D as the concluding remarks: write & lt; user name & gt; root sends information to the luxh user [root @ l...
Common Linux commands (6) -- Network Communication commands 1. command name: write www.2cto.com execution permission: all users function description: send information to another user, with CTRL + D as the end syntax: write <用户名> Root sends information to the luxh user [root @ localhost ~] # Write luxhwrite: luxh is logged in more than once; writing to pts/1 hello, luxh, I am root user luxh receives the information [luxh @ localhost ~] $ Message from luxh@localhost.localdomain (as root) on pts/0... hello, luxh, I am root user sends messages to the luxh user. the luxh user must have logged in; otherwise, it cannot be sent. 2. command name: wall execution permission: all users function description: Broadcast information syntax to all users: wall [message] [file name] root sends information to all login users [root @ localhost ~] # Wall Happy New Year Broadcast message from root@localhost.localdomain (pts/0) (Thu Nov 22 05:27:49 2012): Happy New Year [root @ localhost ~] # Login users can receive www.2cto.com [luxh @ localhost ~] $ Broadcast message from root@localhost.localdomain (pts/0) (Thu Nov 22 05:27:49 2012): Happy New Year 3, Command Name: ping run permission: root function description: test network connectivity syntax: ping [option] directly ping the IP address in Linux and press CTRL + C to terminate the command. Otherwise, the IP address will be pinged [root @ localhost ~] # Ping 192.168.1.1PING 192.168.1.1 (192.168.1.1) 56 (84) bytes of data.64 bytes from 192.168.1.1: icmp_seq = 1 ttl = 128 time = 6.66 ms64 bytes from 192.168.1.1: icmp_seq = 2 ttl = 128 time = 6.63 ms64 bytes from 192.168.1.1: icmp_seq = 3 ttl = 128 time = 3.13 ms64 bytes from 192.168.1.1: icmp_seq = 4 ttl = 128 time = 4.55 ms64 bytes from 192.168.1.1: icmp_seq = 5 ttl = 128 time = 6.69 ms64 bytes from 192.168.1.1: icmp_seq = 6 ttl = 128 time = 5.90 ms64 bytes from 192.168.1.1: icmp_seq = 7 ttl = 128 time = 2.77 ms64 bytes from 192.168.1.1: icmp_seq = 8 ttl = 128 time = 2.75 ms64 bytes from 192.168.1.1: icmp_seq = 9 ttl = 128 time = 5.41 ms64 bytes from 192.168.1.1: icmp_seq = 10 ttl = 128 time = 7.52 MS use-c to specify the number of ping times [luxh @ localhost ~] $ Ping-c 4 192.168.1.1PING 192.168.1.1 (192.168.1.1) 56 (84) bytes of data.64 bytes from 192.168.1.1: icmp_seq = 1 ttl = 128 time = 6.49 ms64 bytes from 192.168.1.1: icmp_seq = 2 ttl = 128 time = 5.42 ms64 bytes from 192.168.1.1: icmp_seq = 3 ttl = 128 time = 2.46 ms64 bytes from 192.168.1.1: icmp_seq = 4 ttl = 128 time = 3.69 MS --- 192.168.1.1 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 30 10 msrtt min/avg/max/mdev = 2.464/4.520/6.498/1.551 MS [luxh @ localhost ~] $ Use-s to specify the size of the sending package. The maximum size cannot exceed 65507 bytes [root @ localhost ~] # Ping-c 4-s 1024 192.168.1.1PING 192.168.1.1 (192.168.1.1) 1024 (1052) bytes of data.1032 bytes from 192.168.1.1: icmp_seq = 1 ttl = 128 time = 6.67 ms1032 bytes from 192.168.1.1: icmp_seq = 2 ttl = 128 time = 4.21 ms1032 bytes from 192.168.1.1: icmp_seq = 3 ttl = 128 time = 9.06 ms1032 bytes from 192.168.1.1: icmp_seq = 4 ttl = 128 time = 5.09 MS --- 192.168.1.1 ping statistics --- 4 packets transmitted, 4 received, 0% Packet loss, time 3010 msrtt min/avg/max/mdev = 4.212/6.262/9.064/1.845 MS [root @ localhost ~] #4. command name: ifconfig execution permission: root function description: View network settings syntax: ifconfig [-a] [Nic device ID]-a displays information about all NICs (which can be omitted in Linux and cannot be omitted in Unix) [root @ localhost ~] # Ifconfigeth0 Link encap: Ethernet HWaddr 00: 0C: 29: 4C: 63: 3E inet addr: 192.168.0.102 Bcast: 192.168.0.255 Mask: 255.255.255.0 inet6 addr: fe80: 20c: 29ff: fe4c: 633e/64 Scope: Link up broadcast running multicast mtu: 1500 Metric: 1 RX packets: 4238 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 3578 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 4560042 (4.3 MiB) TX bytes: 299 603 (292.5 KiB) Interrupt: 19 Base address: 0x2024 lo Link encap: Local Loopback inet addr: 127.0.0.1 Mask: 255.0.0.0 inet6 addr: 1/128 Scope: host up loopback running mtu: 16436 Metric: 1 RX packets: 8 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 8 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 0 RX bytes: 480 (480.0 B) TX bytes: 480 (480.0 B) eth0 is the actual physical Nic, lo is the Virtual loopback address. the IP address of the NIC is changed temporarily. it is invalid after restart [Root @ localhost ~] # Ifconfig eth0 192.168.1.5
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.