首页 > 技术文章 > linux 常用命令

adolfmc 2016-10-29 21:37 原文

查看文件大小
du -h --max-depth=1 /home/*

 

 更改时区

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

 

查看开启端口号

netstat -anplut

lsof -i:80

如果有显示说明已经开放了,如果没有显示说明没有开放

 

centos安装wget

yum -y install wget

 

chown mysql:mysql -R /data/mysql/

chcon -R -t mysqld_db_t /home/data/mysql

 

查看端口号

netstat -nlp | grep  端口号

lsof -i | grep 进程号

 

关闭防火墙 :systemctl stop firewalld.service
sudo systemctl stop firewalld.service && sudo systemctl disable firewalld.service

 

更改hostname :vi /etc/hosts

设置防火墙:vi /etc/sysconfig/iptables

HOST地址:vi /etc/hosts

推荐阅读