Linux常用命令(6)–網路通訊命令

來源:互聯網
上載者:User

1、命令名稱:write

  執行許可權:所有使用者

  功能描述:向另外一個使用者發送資訊,以CTRL+D作為結束

  文法:write <使用者名稱>

root向luxh使用者發送資訊[root@localhost ~]# write luxhwrite: luxh is logged in more than once; writing to pts/1hello,luxh,i am root使用者luxh接收到的資訊為[luxh@localhost ~]$ Message from luxh@localhost.localdomain (as root) on pts/0 at 05:17 ...hello,luxh,i am root

  root使用者向luxh使用者發送資訊,luxh使用者必須已經登陸,否則是發送不了的。

 

2、命令名稱:wall

  執行許可權:所有使用者

  功能描述:向所有使用者廣播資訊

  文法:wall [message]  [檔案名稱]

root向所有登陸使用者發送資訊[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 ~]#已登陸的使用者就可以收到[luxh@localhost ~]$ Broadcast message from root@localhost.localdomain (pts/0) (Thu Nov 22 05:27:49 2012):Happy New Year

 

3、命令名稱:ping

  執行許可權:root

  功能描述:測試網路連通性

  文法:ping [選項]  IP地址

在Linux下直接ping ID,按CTRL+C終止命令,否則會一直ping
[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

  

 使用 -c 指定ping的次數
[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 3010msrtt min/avg/max/mdev = 2.464/4.520/6.498/1.551 ms[luxh@localhost ~]$

 

使用 -s 指定發送包的大小,最大不能超過65507位元組
[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 3010msrtt min/avg/max/mdev = 4.212/6.262/9.064/1.845 ms[root@localhost ~]#

  

4、命令名稱:ifconfig

  執行許可權:root

  功能描述:查看網路設定資訊

  文法:ifconfig [-a]  [網卡裝置標識]

      -a  顯示所有網卡的資訊 (在Linux系統中可以省略,在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: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/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是實際的物理網卡,lo是虛擬迴環地址網卡

臨時改變IP地址,重啟後無效[root@localhost ~]# ifconfig eth0 192.168.1.5

 

 

 

 

 

 

 

 

 

 

 

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.