您的位置:首页 > 理论基础 > 计算机网络

Linux常用命令之五:网络命令

2016-02-18 12:12 495 查看
语法:write <用户名>功能描述:给用户发信息,以Ctrl+D保存结束
范例:
# write cf

[root@yun01 ~]# write cf

write: cf is logged in more than once; writing to pts/1

hello

i want to meet you

[root@yun01 ~]#



[root@yun01 ~]# wall yun

[root@yun01 ~]#

Broadcast message from root@yun01 (pts/0) (Wed Feb 17 19:40:37 2016):

yun

[root@yun01 ~]# write cf

write: cf is logged in more than once; writing to pts/1

hello

i want to meet you

[root@yun01 ~]# ^C

[root@yun01 ~]# wall hello everyone it is time to have lunch

[root@yun01 ~]#

Broadcast message from root@yun01 (pts/0) (Wed Feb 17 19:50:38 2016):

hello everyone it is time to have lunch

[yun@yun01 Desktop]$

Broadcast message from root@yun01 (pts/0) (Wed Feb 17 19:40:37 2016):

yun

Message from cf@yun01 (as root) on pts/0 at 19:41 ...

hello

i want to meet you

EOF

Broadcast message from root@yun01 (pts/0) (Wed Feb 17 19:50:38 2016):

hello everyone it is time to have lunch

语法:ping 选项
IP地址

-c 指定发送次数功能描述:测试网络连通性

范例: # ping 192.168.1.156

[root@yun01 ~]# ping www.baidu.com

PING www.a.shifen.com (220.181.111.188) 56(84) bytes of data.

64 bytes from 220.181.111.188: icmp_seq=1 ttl=128 time=6.06 ms

64 bytes from 220.181.111.188: icmp_seq=2 ttl=128 time=3.69 ms

64 bytes from 220.181.111.188: icmp_seq=3 ttl=128 time=10.4 ms

64 bytes from 220.181.111.188: icmp_seq=4 ttl=128 time=80.7 ms

64 bytes from 220.181.111.188: icmp_seq=5 ttl=128 time=7.31 ms

64 bytes from 220.181.111.188: icmp_seq=6 ttl=128 time=11.1 ms

^C

--- www.a.shifen.com ping statistics ---

6 packets transmitted, 6 received, 0% packet loss, time 5605ms

rtt min/avg/max/mdev = 3.695/19.896/80.724/27.319 ms

[root@yun01 ~]#

命令名称:ifconfig命令英文原意:interface
configure命令所在路径:/sbin/ifconfig执行权限:root

语法:ifconfig 网卡名称
IP地址功能描述:查看和设置网卡信息范例:# ifconfig eth0 192.168.8.250

命令名称:last

命令所在路径:/usr/bin/last执行权限:所有用户

语法:last功能描述:列出目前与过去登入系统的用户信息范例:# last

命令名称:lastlog 命令所在路径:/usr/bin/lastlog 执行权限:所有用户

语法:lastlog 功能描述:检查某特定用户上次登录的时间 范例:# lastlog

# lastlog -u 502

命令名称:traceroute命令所在路径:/bin/traceroute执行权限:所有用户

语法:traceroute功能描述:显示数据包到主机间的路径范例:# trace route www.baidu.com

命令名称:netstat命令所在路径:/bin/netstat执行权限:所有用户语法:netstat [选项]功能描述:显示网络相关信息

选项

-t : TCP协议

-u :UDP协议

-l :监听

-r :路由

-n :显示IP地址和端口号

范例:

# netstat -tlun 查看本机监听的端口

# netstat -an 查看本机所有的网络连接

# netstat -rn 查看本机路由表

命令名称:setup 命令所在路径:/usr/bin/setup

执行权限:root

语法:setup

功能描述:配置网络范例:# setup

命令名称:mount

命令位置:/bin/mount

执行权限:所有用户

命令语法:mount [-t 文件系统]
设备文件名 挂载点

范例:# mount -t iso9660 /dev/sr0 /mnt/cdrom
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: