This is from just a single memcached server with around 20M keys (no expiry) and around 2G of data.
What\'s the easiest way to get a dump of all the key/value pairs
Using Bash and save into the file:
exec {memcache}<>/dev/tcp/localhost/11211 printf "stats items\nquit\n" >&${memcache} cat <&${memcache} > myfile.txt
Related: Writing a Redis client in pure bash (it's Redis, but very similar approach)