Skip to content

Instantly share code, notes, and snippets.

@polonskiy
Created August 21, 2013 06:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save polonskiy/6290981 to your computer and use it in GitHub Desktop.
Save polonskiy/6290981 to your computer and use it in GitHub Desktop.
get all memcached keys and values
echo 'stats items' | nc localhost 11211 | while read line; do echo $line | grep -Po 'STAT items:\d+' | grep -Po '\d+'; done | sort -u | xargs -L1 -i echo 'stats cachedump {} 100' | nc localhost 11211 | grep 'ITEM' | sed 's/ITEM \([^ ]\+\) .*/\1/' | xargs -L1 -i echo 'get {}' | nc localhost 11211
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment