Answers:
是。您可以清除内存缓存。尝试:
telnet localhost 11211
flush_all
quit
如果内存缓存未在本地主机11211上运行,则必须对其进行调整。
使用netcat也可以使用
echo "flush_all" | nc -q 2 localhost 11211
然后,只需等待“确定”即可。
printf "flush_all\nquit\n" | nc -q -1 127.1 11211
echo "flush_all" | nc -w 2 localhost 11211
printf "flush_all" | nc localhost 11211
(sleep 2; echo flush_all; sleep 2; echo quit; ) | telnet 127.0.0.1 11211
如果您想非交互式地运行它
感谢@heiko
nc. Note that I worked fine for me without either the initial
有用,因为我有一个主机,我不想安装sleep或final quit
。我做到了( echo 'flush_all' ; sleep 2 ) | telnet myhost.fqdn.com 11211