遇到的linux命令总结

  1. 立即关机 ,立即重启

    shutdown -h now  立即关机  ;   shutdown -r now 立即重启
  2. 查看Ip

    ip addr (万能)   注:最小化安装会默认没有  ifconfig 命令
  3. Tab键命令补全

    yum -y install bash-completion   
  4. 查看防火墙状态

     systemctl  status firewalld
  1. 关闭防火墙

    systemctl stop firewalld
  1. 关闭防火墙自启

    systemctl disable firewalld
  1. 开启防火墙

    systemctl restart firewalld 
  1. 开启防火墙自启动

    systemctl enable firewalld
  1. 查看主机名称

    hostname
  1. 修改主机名称

    hostnamectl set-hostname  xxxx
  1. 查看文件

    cat /etc/hosts  
  1. 查看当前所在路径

    pwd 
  1. 显示进程状态

    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
  1. 快速查找文件 find 命令

    find / -name httpd.conf  #在根目录下查找文件httpd.conf,表示在整个硬盘查找

find更多操作与查找文件方式请看这里

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值