-
立即关机 ,立即重启
shutdown -h now 立即关机 ; shutdown -r now 立即重启
-
查看Ip
ip addr (万能) 注:最小化安装会默认没有 ifconfig 命令
-
Tab键命令补全
yum -y install bash-completion
-
查看防火墙状态
systemctl status firewalld
-
关闭防火墙
systemctl stop firewalld
-
关闭防火墙自启
systemctl disable firewalld
-
开启防火墙
systemctl restart firewalld
-
开启防火墙自启动
systemctl enable firewalld
-
查看主机名称
hostname
-
修改主机名称
hostnamectl set-hostname xxxx
-
查看文件
cat /etc/hosts
-
查看当前所在路径
pwd
-
显示进程状态
ps 显示当前运行的进程 ps -a 显示所有进程 ps -u 显示详细信息 ps -aux 显示所有包含其他使用者的行程 配合管道符使用:查看关于nginx的详细信息,比如可以查找nginx所在的路径 例:ps -aux |grep nginx ---------------------------------------------- root 50067 0.0 0.3 128884 6304 ? Ss 20:43 0:00 nginx: master process /www/server/nginx/sbin/nginx -c /www/server/nginx/conf/nginx.conf www 60790 0.0 1.4 159604 28924 ? S 20:45 0:00 nginx: worker process www 60791 0.0 0.2 128756 5252 ? S 20:45 0:00 nginx: cache manager process root 61365 0.0 0.0 112832 980 pts/1 R+ 21:21 0:00 grep --color=auto nginx
-
快速查找文件 find 命令
find / -name httpd.conf #在根目录下查找文件httpd.conf,表示在整个硬盘查找