centos-7-x86_64 Common Commands

Source: Internet
Author: User

Modify IP Address
vi /etc/sysconfig/network-scripts/ifcfg-eno16777728ONBOOT="yes"    --yes自动启动网络,no代表关闭BOOTPROTO="dhcp"    --DHCP或者static、noneIPADDR=192.168.179.3NETMASK=255.255.255.0GATEWAY=192.168.179.2DNS1=222.222.222.222DNS2=8.8.8.8
Restart Network Service
Shutting down the firewall
CentOS7版本后防火墙默认使用firewalld,因此在CentOS7中关闭防火墙使用以下命令systemctl status firewalld  //查看防火墙状态systemctl stop firewalld    //临时关闭systemctl disable firewalld     //禁止开机启动

--systemctl command Explanation

systemctl命令是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。启动一个服务:systemctl start firewalld.service关闭一个服务:systemctl stop firewalld.service重启一个服务:systemctl restart firewalld.service显示一个服务的状态:systemctl status firewalld.service在开机时启用一个服务:systemctl enable firewalld.service在开机时禁用一个服务:systemctl disable firewalld.service查看服务是否开机启动:systemctl is-enabled firewalld.service查看已启动的服务列表:systemctl list-unit-files|grep enabled查看启动失败的服务列表:systemctl --failed
Restart, shutdown
reboot  #重启init 0  #关机
Install common components
yum -y install vim*         #安装vim组件yum -y install wget*        #安装wget
wget command
-c      断点续传-P      指定下载目录,不指定的话就下载到当前目录wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpmwget -P /home/ http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
View version number
cat /etc/centos-release     #翻译:CentOS的发行版
Vim operation
:q      #退出不保存:q!     #强制退出不保存:wq     #保存并退出:x      #保存并退出    :x和:wq的真正区别,如下:    :wq 强制性写入文件并退出。即使文件没有被修改也强制写入,并更新文件的修改时间。    :x 写入文件并退出。仅当文件被修改时才写入,并更新文件修改时间,否则不会更新文件修改时间。
SS command
-h:显示帮助信息;-V:显示指令版本信息;-n:不解析服务名称,以数字方式显示;-a:显示所有的套接字;-l:显示处于监听状态的套接字;-o:显示计时器信息;-m:显示套接字的内存使用情况;-p:显示使用套接字的进程信息;-i:显示内部的TCP信息;-4:只显示ipv4的套接字;-6:只显示ipv6的套接字;-t:只显示tcp套接字;-u:只显示udp套接字;-d:只显示DCCP套接字;-w:仅显示RAW套接字;-x:仅显示UNIX域套接字。ss -t -a -4     #查看TCP连接
Add EPEL Extension Source
yum install epel-release

centos-7-x86_64 Common Commands

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.