系统时间与开关机

  • 查看系统时间

    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

最新文章

  1. java内存划分
  2. 华为地铁换乘 Java
  3. Input path does not exist: file:/.......
  4. 关于eclipse入门开发c/c++文章推荐
  5. 20135316王剑桥 linux第十一周课实验笔记
  6. 一、HTML和CSS基础--网页布局--网页布局基础
  7. FTP文件夹打开错误,Windows无法访问此文件夹
  8. Android设计模式系列-适配器模式
  9. frame 第三节
  10. D3.js-坐标轴生成测试SVG
  11. Learning to rank的讲解,单文档方法(Pointwise),文档对方法(Pairwise),文档列表方法(Listwise)
  12. SpringMVC中 -- @RequestMapping的作用及用法
  13. 『Github』简易使用指南
  14. sessionStorage和localStorage
  15. [转]Loadrunner经典面试题
  16. 【推导】【构造】XVII Open Cup named after E.V. Pankratiev Stage 14, Grand Prix of Tatarstan, Sunday, April 2, 2017 Problem E. Space Tourists
  17. Google Analytics Overview - Google Analytics 概述
  18. IO流之缓冲流
  19. LVS-DR模式实现调度负载
  20. 42-EF Core Migration

热门文章

  1. Nmap linux端口扫描神器
  2. MatLab之HDL coder
  3. I2C controller core之Bit controller(03)
  4. layui 下拉框取值
  5. C# 增加 删除 更新 方法
  6. tomcat ider配置
  7. 在centos 配置python django环境 总结
  8. GFS分布式文件系统环境部署与管理
  9. BZOJ 1106: [POI2007]立方体大作战tet 树状数组 + 贪心
  10. 非传统题初探——AtCoder Practice Contest #B - インタラクティブ練習 (Interactive Sorting)