CentOS常用操作笔记

 

init 3 关闭图形界面

init 5 开启图形界面

 

开机默认不进入图形界面:

vi /etc/inittab

id:5:initdefault:

改为

id:3:initdefault:

 

查看8005端口占用情况

lsof -i:8005

 

查看Linux服务器的版本

lsb_release -a 

 

查看当前iptables(防火墙)规则

  可使用"iptables –L –n"查看当前iptables规则

查看防火墙状态:service iptables status  

停止防火墙:service iptables stop  

启动防火墙:service iptables start  

重启防火墙:service iptables restart  

永久关闭防火墙:chkconfig iptables off  

永久关闭后重启:chkconfig iptables on

 

添加指定端口到防火墙中

iptables -I INPUT -p 协议 --dport 端口号 -j ACCEPT

iptables -I INPUT -p udp --dport 161 -j ACCEPT 

iptables -I INPUT -p tcp --dport 8080 -j ACCEPT

 

查看当前路径:  pwd             /home/samlee

 

使用rpm -qa | grep httpd查看是否已经安装了httpd

使用ps -ef | grep httpd查看httpd的进程

使用service httpd status查看httpd的运行状态

使用service httpd stop可以停止httpd

使用service httpd start 可以启动httpd

find / -name apsx

 

查看进程端口: ps aux | grep yum

终止进程:kill -9 pid

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值