Linux - 网络相关指令
2024-08-31 08:09:17
系统时间与开关机
查看系统时间
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
最新文章
- java内存划分
- 华为地铁换乘 Java
- Input path does not exist: file:/.......
- 关于eclipse入门开发c/c++文章推荐
- 20135316王剑桥 linux第十一周课实验笔记
- 一、HTML和CSS基础--网页布局--网页布局基础
- FTP文件夹打开错误,Windows无法访问此文件夹
- Android设计模式系列-适配器模式
- frame 第三节
- D3.js-坐标轴生成测试SVG
- Learning to rank的讲解,单文档方法(Pointwise),文档对方法(Pairwise),文档列表方法(Listwise)
- SpringMVC中 -- @RequestMapping的作用及用法
- 『Github』简易使用指南
- sessionStorage和localStorage
- [转]Loadrunner经典面试题
- 【推导】【构造】XVII Open Cup named after E.V. Pankratiev Stage 14, Grand Prix of Tatarstan, Sunday, April 2, 2017 Problem E. Space Tourists
- Google Analytics Overview - Google Analytics 概述
- IO流之缓冲流
- LVS-DR模式实现调度负载
- 42-EF Core Migration
热门文章
- Nmap linux端口扫描神器
- MatLab之HDL coder
- I2C controller core之Bit controller(03)
- layui 下拉框取值
- C# 增加 删除 更新 方法
- tomcat ider配置
- 在centos 配置python django环境 总结
- GFS分布式文件系统环境部署与管理
- BZOJ 1106: [POI2007]立方体大作战tet 树状数组 + 贪心
- 非传统题初探——AtCoder Practice Contest #B - インタラクティブ練習 (Interactive Sorting)