CentOS7.2 基本操作、ssh操作、防⽕墙命令

CentOS7.2 基本操作

虚拟机⽤户界⾯防⽌⿊屏:settings-电源和隐私-关闭屏保和⾃锁

openjdk的jmap安装: yum install java-1.8.0-openjdk-devel

netstat -lnpt 查看端⼝占⽤情况(TCP)

netstat -lnp | grep XXXX 查看端⼝/进程号占⽤情况

jps -lv | grep -v xyz 查看java所占⽤的进程(不包含xyz)

jps -lv | grep xyz 查看java所占⽤的进程(包含xyz)

ifconfig | grep "inet " | grep -v 127.0.0.1 查看本机IP地址

CentOS7.2 ssh操作

ssh登录退出

ssh -p 9091 [email protected] 登录

logout 或者 exit 退出

ssh⽂件传输

服务器⽂件到本地⽬录

scp [email protected]:/home/gsafety/test.jar /usr/local/jiangsu

服务器⽂件夹到本地⽬录

scp -r [email protected]:/home/gsafety/bigScreen /usr/local/jiangsu

scp -r -P 9091 [email protected]:/opt/atlassian-extras-2.4.jar /Users/Fang/Downloads

本地⽂件到服务器⽬录

scp -P 9091 hg.war [email protected]:/usr/local (!!注意端⼝P要⼤写)

CentOS7.2 防⽕墙命令

systemctl start firewalld.service 启动

systemctl stop firewalld.service 关闭

systemctl restart firewalld.service 重启

systemctl enable firewalld.service 开机时启⽤

systemctl disable firewalld.service 开机时禁⽤

systemctl is-enabled firewalld.service 是否开机启动

firewall-cmd --zone=public --list-ports 查看所有打开的端⼝

firewall-cmd --state 查看防⽕墙状态

firewall-cmd --zone=public --add-port=80/tcp --permanent 添加端⼝

firewall-cmd --reload 重新载⼊

firewall-cmd --zone=public --query-port=80/tcp 查看端⼝

firewall-cmd --zone=public --remove-port=80/tcp --permanent 删除端⼝

你可能感兴趣的:(java,开发语言,后端,经验分享)