VPS 常用命令

带宽测试

wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
python speedtest.py --share
python speedtest.py --list
python speedtest.py --share --server 6962

wget -qO- bench.sh | bash
wget http://cachefly.cachefly.net/100mb.test && rm -f 100mb.test

硬盘内存处理器

df -h
free -m
dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync && rm -f test
cat /proc/cpuinfo


查看分析磁盘占用

df -h
du -s -h *
du -s -h /*

更改文件权限及用户

chmod -R 755 /home
chown -R www:www /home

文件操作

tar zcvf vps.tar.gz vps //使用tar打包vps文件夹,文件名为:vps.tar.gz
tar zxvf //解压
unzip //解压zip
rm -rf //删除

服务管理

service iptables restart //重启防火墙
service shadowsocks-libev start
netstat -atn
sh /root/kcptun/start.sh //启动
sh /root/kcptun/stop.sh //停止

yum安装

yum install cronie
yum install lighttpd
yum install epel-release
yum install bind-utils
yum install mtr
yum install traceroute
yum install shadowsocks-libev

更改时区

date -R
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

更改DNS

cat /etc/resolv.conf

nameserver 208.67.222.222
nameserver 208.67.220.220
nameserver 74.82.42.42
nameserver 2001:470:20::2
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 2001:4860:4860::8888
nameserver 2001:4860:4860::8844

chattr +i /etc/resolv.conf
chattr -i /etc/resolv.conf
ping www.facebook.com
ping www.youtube.com
ping twitter.com