redis 批量删除操作

redis 原生删除方法

del key1 key2 ...

只支持显示删除

使用*通配符 和 xargs可以很方便地进行批量删除

 形式如下:

redis-cli -h 192.168.1.45 -p 6379 keys "*" | xargs redis-cli -h 192.168.1.45 -p 6379 -n 6  del

*通配符:匹配所有字符

 补充:

xargs的使用方法

扫描二维码关注公众号,回复: 1683073 查看本文章

https://blog.csdn.net/yongan1006/article/details/8134581

猜你喜欢

转载自www.cnblogs.com/faithfu/p/9210452.html