Linux下常用操作

来源:互联网 发布:淘宝宝贝首图优化 编辑:程序博客网 时间:2024/06/06 19:27

老忘,老得查,不如记下来


1.如何查看端口状态
firewall-cmd --list-ports
显示说: FirewallD is not running
所以开启防火墙:
systemctl start firewalld 
补充:
firewall-cmd --reload #重启firewall
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
2.如何永久改PS1:


vim         ~/.bashrc
例如在最后加上这个 (很好看的)
# User specific environment and startupprograms 
PS1="\[\e[32;1m\][\u@\h \w]$\[\e[m\]"

3.使文件生效

source

如:#source /etc/profile

4.重启网络

 service network restart

或者 /etc/init.d/network restart


原创粉丝点击