Common Linux commands (6)-network communication commands

Source: Internet
Author: User

1. Command name: Write

Execution permission: All Users

Function Description: sends a message to another user, ending with Ctrl + D.

Syntax: Write <User Name>

 
Root sends information to the luxh user [root@ Localhost ~]#Write luxhWrite: luxh is loggedInMore than once; writing to PTS/1Hello, luxh, I am root, the information that luxh receives is [luxh@ Localhost ~] $Message from luxh@ Localhost. localdomain (as root) on pts/0 at 05:17... Hello, luxh, I am Root

The root user sends a message to the luxh user. The luxh user must have logged on; otherwise, the message cannot be sent.

 

2. Command name: Wall

Execution permission: All Users

Function Description: broadcasts information to all users.

Syntax: Wall [Message] [file name]

 
Root sends information to all login users [root@ Localhost ~]#Wall happy new yearBroadcast message from Root@ Localhost. localdomain (pts/0) (Thu Nov 22 05:27:49 2012): Happy New Year [root@ Localhost ~]#The logged-on user can receive the [luxh@ Localhost ~] $Broadcast message from Root@ Localhost. localdomain (pts/0) (Thu Nov 22 05:27:49 2012): Happy New Year

 

3. Command name: Ping

Execution permission: Root

Function Description: test network connectivity.

Syntax: Ping [Option] IP Address

In Linux, ping the ID directly and press Ctrl + C to terminate the command. Otherwise, Ping
[Root @ localhost ~] # Ping 192.168.1.1 Ping 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 MS 64 bytes from 192.168.1.1: icmp_seq = 2 TTL = 128 time = 6.63 MS 64 bytes from 192.168.1.1: icmp_seq = 3 TTL = 128 time = 3.13 MS 64 bytes from 192.168.1.1: icmp_seq = 4 TTL = 128 time = 4.55 MS 64 bytes from 192.168.1.1: icmp_seq = 5 TTL = 128 time = 6.69 MS 64 bytes from 192.168.1.1: icmp_seq = 6 TTL = 128 time = 5.90 MS 64 bytes from 192.168.1.1: icmp_seq = 7 TTL = 128 time = 2.77 MS 64 bytes from 192.168.1.1: icmp_seq = 8 TTL = 128 time = 2.75 MS 64 bytes from 192.168.1.1: icmp_seq = 9 TTL = 128 time = 5.41 MS 64 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.1Ping192.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.49MS64 bytes from 192.168.1.1: icmp_seq = 2 TTL = 128 time = 5.42MS64 bytes from 192.168.1.1: icmp_seq = 3 TTL = 128 time = 2.46MS64 bytes from 192.168.1.1: icmp_seq = 4 TTL = 128 time = 3.69MS--- 192.168.1.1 Ping statistics --- 4 packets transmitted, 4 encrypted ed, 0%Packet Loss, time 3010 msrtt min/AVG/max/mdev = 2.464/4.520/6.498/1.551MS [luxh@ Localhost ~] $

 

Use-s to specify the size of the sending package, up to 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.67MS1032 bytes from 192.168.1.1: icmp_seq = 2 TTL = 128 time = 4.21MS1032 bytes from 192.168.1.1: icmp_seq = 3 TTL = 128 time = 9.06MS1032 bytes from 192.168.1.1: icmp_seq = 4 TTL = 128 time = 5.09MS--- 192.168.1.1 Ping statistics --- 4 packets transmitted, 4 encrypted ed, 0%Packet Loss, time 3010 msrtt min/AVG/max/mdev = 4.212/6.262/9.064/1.845MS [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 network adapters (this information can be omitted in Linux and cannot be omitted in UNIX)

[Root @ localhost ~] #  Ifconfig Eth0 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/64Scope: 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: 299603 (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/128Scope: 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, and lo is the virtual loopback address Nic.

 
Temporarily change the IP address, which is invalid after restart [root@ Localhost ~]#Ifconfig eth0 192.168.1.5

 

 

 

 

 

 

 

 

 

 

 

 

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.