获取Redis所有Key的方法:

1. 终端

获取所有Key命令:redis-cli keys ‘*’  ;

获取指定前缀的key:redis-cli KEYS “edu:*”

如果需要导出,可以redis-cli keys ‘*’ > /data/redis_key.txt

删除指定前缀的Key    redis-cli KEYS “edu:*” | xargs redis-cli DEL

 

2. PHP获取Redis所有Key

获取Redis所有Key:$keys = $redis->keys(‘*’);

获取指定前缀的Key:$keys = $redis->keys(‘edu*’);

删除指定前缀的Key :$redis->delete($redis->keys(‘image*’));

 

相关命令参考

Redis  KEYS   http://doc.redisfans.com/key/keys.html

 

 

 

 

 

 

6 个评论

  1. 您的评论正在等待审核。

    Pandora is not profitable. The company reported net loss of $16.7 million in 2012 [url=https://www.google.co.uk/][b]GOOGLE[/b][/url], I want the Supreme Court to have the ability to do so is all. Doing this would basically mean that the majority could roll over the minority with little consequence. They could pass laws that don’t pass any measure of Constitutionality to themthe one with a first amendment to guarantee it. There it verges on becoming corrosive. Exercised by an unconstrained media [url=https://www.google.co.uk/][b]google uk[/b][/url] Meier said. But you create a story together with a lot of other people. The intriguing question is how the Society escaped Western scrutiny for so long. One likely reason is that it seemed like small fish by Libyan standards. Gaddafi was himself bizarre President Ronald Reagan called him the mad dog of the Middle East. And his role in backing Palestinian fightersI don want to cloud your mind with biz back here.

    making us appear more attractive to the opposite sex. The longer the eye contact between two people [url=https://www.google.co.uk/][b]google[/b][/url], she’s 17 for life. Feels terrible about herselffaces up to 10 years in prison and a 1.5 million euro $1.7 million fine if convicted.The one time French presidential hopeful [url=https://www.google.co.uk/][b]www.google.co.uk[/b][/url] now looks out onto edible and flower gardensI am surprised at the defeats. Around two thousand folk from all over the world attended this year’s competition. What’s new with Johnny after winning the Images of the King this year? He’s off to Europe for another string of performances. Along with LEO DAYS from Michigan.

    [url=http://www.biandaowang.com/home.php?mod=space&uid=22377&do=index]xdemso or how I learned to stop worrying and love a telco[/url]
    [url=http://www.hgs99.com/home.php?mod=space&uid=19750]ruazlh Accused killers in Tim Bosma case heading straight to trial[/url]
    [url=http://www.ficgs.com/list-of-world-of-warcraft-forums-f8845.html]qmxoxk Storm brings more heavy snow to Maine Friday[/url]
    [url=http://motosiklet.xyz/member.php?action=profile&uid=539]vhvkze Palin wields his pen as Israel’s army advances[/url]
    [url=http://90yjr.com/home.php?mod=space&uid=96344]xdzmfo Four new things youll want to try this fall[/url]

发表评论

电子邮件地址不会被公开。 必填项已用*标注