Any architecture that is out of business is bullying
Log only the Linux commands that are actually used
Common Linux Commands
To find the installation path:
whereis nginx
Query Nginx Process:
ps aux|grep nginx
To view the CentOS kernel version:
# 查看内核版本uname -r
Uninstall Docker :
# 查看yum|grep# 卸载yum -y remove docker.xxx.x86_64# 删除rm -ef /var/lib/docker
#查看ip信息ip add#显示当前路径的全路径 pwd#文件复制 cp -r /bashrc /bak/bashrc#更新yum
Monitoring file content changes:
tail
cat 查看文档内容
more 分页查看文档内容
ls -a 列出所有文件
cp -r tomcat-xxxx tomcat-xxxx-new 拷贝文件夹及文件夹内文件
rm -rf logs 强制删除文件夹或文件
echo "">catalina.out 清空文件内容
# 找到 tomcat-x-cas-server 的进程,# 第二个参数是 pid# 通过 pid 杀死进程ps|grep"tomcat-x-cas-server"|grep|awk'{print $2}'|xargs kill -9
Curl uses
See Curl Notes
VI Use
See VI Notes
CentOS7 Common Configuration System time Synchronization
Network configuration
VM Clone system set static IP
cd/etc/sysconfig/network-scripts/
vi ifcfg-eno16777736
Comment out the UUID, HWADDR
TYPE="Ethernet"BOOTPROTO="static"DEFROUTE="yes"IPV4_FAILURE_FATAL="yes"IPV6INIT="yes"IPV6_AUTOCONF="yes"IPV6_DEFROUTE="yes"IPV6_FAILURE_FATAL="no"NAME="eno16777736"#UUID="10f47dcb-cc95-4aad-a56c-36fe7920f431"ONBOOT="yes"IPADDR0="192.168.199.200"PREFIX0="24"GATEWAY0="192.168.199.1"DNS1="8.8.8.8"DNS2="9.9.9.9"#HWADDR="00:0C:29:E3:95:59"IPV6_PEERDNS="yes"IPV6_PEERROUTES="yes"
# 重启网络服务service network restart
Modify Host Name
hostnamectl set-hostname java hostnamectl set-hostname server-1
Install Basic Tools
# 安装传统网络工具yum -y install net-tools #安装 wget 文件下载工具yum -y install wget#安装 curl 网络访问工具yum -y install curl
CENTOS7 Development environmentInstalling the Java Environment
yum -y install java-1.8.0-openjdk
Installing the Maven environment
yum -y install maven
Install the GIT environment
yum -y install git
Installing the Tomcat Environment
# 通过 wget 方式下载 apache-tomcat-8.5.23.tar.gzwget http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.23/bin/apache-tomcat-8.5.23.tar.gz# 解压 apache-tomcat-8.5.23.tar.gztar -xzvf apache-tomcat-8.5.23.tar.gz# 启动 tomcat ./startup.sh# 将8080端口添加到防火墙例外并重启firewall-cmd --zone=public --add-port=8080/tcp --permanentfirewall-cmd --reload
Installing the MySQL environment1. Download the MySQL repo source
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
2. Install the MySQL repo source
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
3. Install MySQL
yum -y install mysql-server
Installing the Redis environment1. Set up the Redis warehouse address
yum -y install epel-release
2. Installing Redis
yum -y install redis
3. Configure redis.conf
- Bind 127.0.0.1 to comment out
- Requirepass Redispassword Set Password
4. Developing Redis Ports
# 将6379端口添加到防火墙例外并重启firewall-cmd --zone=public --add-port=6379/tcp --permanentfirewall-cmd --reload
Installing Nginx EnvironmentReload Configuration, restart service
# 重新加载 nginx 配置cd /usr/sbin./nginx -s reload # 重启 nginx 服务service nginx restart
Common Linux Command notes