常见Linux命令
/usr/local/redis/bin/redis-cli -a 123456 –cluster create 10.101.37.179:6381 10.101.37.179:6380 10.101.37.200:6381 10.101.37.200:6380 10.101.37.111:6381 10.101.37.111:6380 –cluster-replicas 1
rm -rf appendonly.aof
rm -rf dump.rdb
rm -rf nodes.conf
/usr/local/redis/bin/redis-server /data/redis/6379/redis.conf
/usr/local/redis/bin/redis-cli -a 123456 -p 6380 shutdown
/usr/local/redis/bin/redis-cli -a 123456
/usr/local/redis/bin/redis-cli -a 123456 –cluster check 10.101.37.179:6381
firewall-cmd –zone=public –list-ports
firewall-cmd –zone=public –add-port=9913/tcp –permanent
firewall-cmd –reload
firewall-cmd –state
npm install –legacy-peer-deps
firewall-cmd –query-port=80/tcp
netstat -tlpn 查询侦听端口
nc -l 8080
ss -tnl
cat /etc/redhat-release 查看Linux操作系统信息
df -h 查看磁盘空间
mysqladmin -u root password 123456
netstat -aon|findstr “8080”
tasklist|findstr “2668”
修改mysql 数据库密码
1 | ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; |
如果安装发生错误,443
安装ca-certificates
yum install ca-certificates -y
或者是w
yum install ssl-cert -y
1. 查看当前编码
echo $LANG
2。设置编码为zh_CN.UTF-8
export LANG=export LANG=zh_CN.UTF-8
3.再次查看当前编码
echo $LANG
ubuntu防火墙
sudo ufw status
sudo ufw enable //开启防火墙
sudo ufw allow 22 //开放22端口
sudo ufw delete allow 21 //关闭21端口
netstat -lntup | awk ‘NR>2{gsub(/.*:/,” “,$4);print $4}’ | grep “ 31059$”
精确找出端口31059
PORT=88
netstat -lntup | awk -v port=”$PORT” ‘NR>2 && $4 ~ “:”port”$” {gsub(/.*:/,””,$4); print $4}’
#-o或–options选项后面接可接受的短选项,如ab:c::,表示可接受的短选项为-a -b -c,其中-a选项不接参数,-b选项后必须接参数,-c选项的参数为可选的
#-l或–long选项后面接可接受的长选项,用逗号分开,冒号的意义同短选项。
#-n选项后接选项解析错误时提示的脚本名字
ARGS=getopt -o s: --long p: -n "$BASH_NAME" -- "$@"
mysqldump