基础阶段

链接地址:https://www.cnblogs.com/shaoshuai2126/articles/15142127.html

补充知识

  1. hostnamectl set-hostname KingCoding 修改主机为KingCoding
  2. [shuai@kingcoding ~]$ shuai当前用户名 , kingcoding 主机名
  3. 退出远程控制的三种方法:
    1. logout
    2. exit
    3. ctrl+d
  4. reboot 重启系统
  5. 修改用户名和密码 https://blog.csdn.net/gahsfjshf/article/details/121115663
  6. ~代表的当前用户的home目录
  7. /代表根目录
  8. 把windows中的文件推送到远程服务器 ```powershell

    使用前先切换到当前文件夹

    scp 文件 用户名@IP地址:目标文件地址

1)推送文件

scp .\apache-tomcat-9.0.64.tar.gz shuai@192.168.145.136:/home/shuai/Desktop

2)推送文件夹

scp -r .\apache-tomcat-9.0.64.tar.gz shuai@192.168.145.136:/home/shuai/Desktop

  1. 9. cat /etc/redhat-release 查看CentOS版本
  2. 9. 查看时区 timedatectl<br />同步时间
  3. ```shell
  4. timedatectl set-timezone Asia/Shanghai
  1. 执行脚本文件
    切换到脚本文件目录
    cd /home/shuai/Documents/ftp/apache-tomcat-9.0.64/bin
    执行脚本
    ./startup.sh
  2. 防火墙玩法 ```shell

    查看firewall服务状态

    firewall-cmd —state

    开启、重启、关闭、firewalld.service服务

    开启

    service firewalld start

    重启

    service firewalld restart

    关闭

    service firewalld stop

    查看防火墙规则

    firewall-cmd —list-all # 查看全部信息 firewall-cmd —list-ports # 只看端口信息

    开启端口

    开端口命令:firewall-cmd —zone=public —add-port=8080/tcp —permanent 关闭端口:firewall-cmd —remove-port=8080/tcp —permanent ##永久移除80端口

端口生效的方法

1、重载使刚才的端口设置生效:firewall-cmd --reload
2、重启防火墙:systemctl restart firewalld.service

命令含义: —zone #作用域 —add-port=80/tcp #添加端口,格式为:端口/通讯协议 —permanent #永久生效,没有此参数重启后失效



13.  在登录页面登不进去问题解决<br />[https://blog.csdn.net/weixin_47316183/article/details/123433080](https://blog.csdn.net/weixin_47316183/article/details/123433080) 
13.  在linux上,为什么不用配置环境变量还能运行java程序呢?<br />[https://blog.csdn.net/wangmaohong0717/article/details/73527213](https://blog.csdn.net/wangmaohong0717/article/details/73527213) 
13.  touch命令 
```shell
touch [命令选项] 文件名

# 创建空文件
touch info.txt
# 批量创建10个文件
touch info_{1..10}.txt

# 更改info.txt的修改时间为当前时间
touch -a info.txt

# 更改访问时间而不用创建新文件
touch -c info.txt
# 更改info.txt的时间与info_1.txt时间戳相同
touch info.txt -r info_1.txt
# 设置文件时间戳
touch info.txt -t 201906241840.50
  1. DockerBuild报错:The command ‘/bin/sh -c yum install -y vim‘ returned a non-zero code: 1
    https://blog.csdn.net/weixin_53402685/article/details/125296621