AWS EC2 相关命令

柴泰平
2023-12-01

#设置时区 

sudo timedatectl set-timezone Asia/Shanghai

 #安装docker

sudo yum update -y
sudo amazon-linux-extras install docker -y
sudo service docker start
sudo systemctl enable docker
sudo usermod -a -G docker ec2-user

#安装ctop

sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.7/ctop-0.7.7-linux-amd64 -O /usr/bin/ctop
sudo chmod +x /usr/bin/ctop

#安装jdk1.8

sudo yum install java-1.8.0-openjdk-devel -y

#查看端口连接数

netstat -an |grep 21001 | awk '/^tcp/ {++sta[$NF]} END {for(key in sta) print key, t, sta[key]}'

 #设置应用文件夹

sudo mkdir /app
sudo chmod 777 /app

 类似资料: