sdycgtgz
10/12/2017 - 9:54 AM

Linuxcmd

Linux

#全文件夹内文本替换
 sed -i "s/桃果/茶叶/g" `grep "桃果" -rl /data/wwwroot/game.tlmy33.cn`
 #跳过堡垒机访问服务器
 你能在堡垒机访问服务器,就可以在服务器上后台跑一个 ssh 
准备一个跳板机修改下 /etc/ssh/sshd_config,加入 => GatewayPorts yes 
然后用在服务器上运行 ssh -f -NR "*:[Port]:localhost:22" [User]@[IP] 
P.S: Port => 跳板机对外端口 
这样访问设置的跳板机 Port,就相当于访问了堡垒机后的服务器
#历史命令排行
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl |  head -n10