Linux - 网络相关指令
2018-01-05 14:39
260 查看
系统时间与开关机
查看系统时间date
查看硬件日期
hwclock
学习Linux不必全部指令都会,只要记住主要常用的几个就可以了。--MK
关机命令
shutdown init reboot poweroff
```
[root@local ~]# shutdown -h +10
Shutdown scheduled for 四 2018-01-04 23:34:56 CST, use 'shutdown -c' to cancel.
[root@local ~]#
Broadcast message from root@local.rhel77.com (Thu 2018-01-04 23:24:56 CST):
The system is going down for power-off at Thu 2018-01-04 23:34:56 CST!
```
十分钟之后关机。
shutdown -c
取消关机。
Linux下端口号的分配
TCP和UDP采用16位的端口号来识别应用程序。2^16 = 65536 一个有0到65535。
TCP端口分配:
21 ftp 文件传输服务 22 ssh 安全远程连接服务 23 telnet 远程连接服务 25 smtp 电子邮件服务 80 http web服务 443 https 安全web服务
UDP端口分配:
69 tftp 简单文件传输协议 123 ntp 时间同步服务
可以通过
vi /etc/services
进入查看详细的端口使用情况。
查看端口的监听状态
netstat
tcp anpt
udp anpu
全部 anput
[root@local ~]# netstat -anput | grep sshd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1227/sshd tcp 0 52 192.168.0.77:22 192.168.0.101:49390 ESTABLISHED 2713/sshd: root@pts tcp6 0 0 :::22 :::* LISTEN 1227/sshd
[root@local ~]# netstat -anput | grep :22 tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1227/sshd tcp 0 52 192.168.0.77:22 192.168.0.101:49390 ESTABLISHED 2713/sshd: root@pts tcp6 0 0 :::22 :::* LISTEN 1227/sshd
[root@local ~]# vi /etc/hostname
修改主机名。
配置hosts文件,DNS解析的时候,先看hosts,再看DNS。
vi /etc/hosts
查看网关情况。
route -n
ping 指令。
[root@local ~]# ping -c 4 www.baidu.com PING www.a.shifen.com (180.97.33.108) 56(84) bytes of data. 64 bytes from 180.97.33.108: icmp_seq=1 ttl=55 time=11.8 ms 64 bytes from 180.97.33.108: icmp_seq=2 ttl=55 time=12.7 ms 64 bytes from 180.97.33.108: icmp_seq=3 ttl=55 time=12.5 ms 64 bytes from 180.97.33.108: icmp_seq=4 ttl=55 time=12.1 ms --- www.a.shifen.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3007ms rtt min/avg/max/mdev = 11.824/12.310/12.732/0.376 ms
相关文章推荐
- linux网络相关指令
- linux下关于网络的相关指令网络(持续中)
- 10.11 Linux网络相关 10.12 firewalld和netfilter 10.13 ne
- linux相关基本操作指令总结
- linux网络相关内容
- 【Linux常用指令整理6】网络通信
- linux视频3(网络配置相关)
- Linux 下网络相关命令
- linux账号管理添加相关指令
- 查看Linux系统版本信息相关指令
- 好文档,Python装饰器、网络相关的命令on linux
- 网络设备发送队列相关数据结构及其创建函数 (linux网络子系统学习 第十节 )
- Linux下网络相关结构体 struct protoent
- linux网络相关命令
- linux网络相关属性的配置
- linux网络相关配置和命令
- Linux netstat命令详解和使用例子(显示各种网络相关信息)
- 自己常用Linux命令的记录--查看硬件相关信息,内核的编译,网络的配置
- 嵌入式Linux之相关网络环境的搭建