知识点汇总

create table test.user like mysql.user

一次创建多个目录
mkdir -p /data/redis-data/redis60{01,02,03,04,05,06,07,08,09,10}

服务器负载
 /bin/cat /proc/loadavg | awk '{print $1}'

外网IP
   /sbin/ifconfig eth0 | /bin/grep Bcast  | /bin/awk -F" " '{print $2}' | /bin/awk -F":" '{print $2}'

内网IP
   /sbin/ifconfig eth1 | /bin/grep Bcast  | /bin/awk -F" " '{print $2}' | /bin/awk -F":" '{print $2}'

从远程拷贝目录到本地
scp -rC [email protected]:/data/app/www/ /tmp/www/ -r 递归复制整个目录。 -v 详细方式显示输出。scp和ssh(1)会显示出整个过程的调试信息。这些信息用于调试连接,验证和配置问题。 -q 不显示传输进度条。 取得nginx pid nginx_pid=$(ps -ef | grep 'nginx: master process' | grep -v grep | awk '{print $2}') 平滑变更nginx配置 kill -HUP $(ps -ef | grep 'nginx: master process' | grep -v grep | awk '{print $2}') 比较简单的平滑变更nginx配置 kill -HUP `cat /data/app/log/nginx.pid` 本地脚本远程执行 ssh username@host bash < /root/sh.sh 当你的机器在内网的时候,可以通过这个命令查看外网的IP。 curl ifconfig.me ls -l /data/app/www/ | awk '{if($5 > 10000) print $0;}' select * from information_schema.processlist where info is not null and time > 0 and info like '%select%'; /usr/bin/mysql --default-character-set=utf8 --socket=/dev/shm/mysql.sock -u"root" -p"123456" -e "show databases\G" |grep Database | awk '{print $2}'

猜你喜欢

转载自bestscw.iteye.com/blog/1806741