This is a simple command line tool allowing you to:
- View basic stats about a Memcached server.
- List keys on a Memcached server (including regex lookups.)
- Delete keys on a Memcached server (including regex lookups.)
To install globally on your system run:
composer global require joelvardy/memcachedtool
To make binaries installed with Composer available globally you must add $COMPOSER_HOME/vendor/bin
to your path, for example:
echo "PATH=\$PATH:\$HOME/.composer/vendor/bin" >> ~/.bashrc
source ~/.bashrc
The default Memcached host and port will be used unless specified, to specify them add --host 129.168.0.48 --port 11322
to the commands.
memcachedtool stats
# All keys
memcachedtool keys
# Keys matching expression
memcachedtool keys --regex "/^post_2_(.*)$/"
# All keys
memcachedtool delete --all
# Keys matching expression
memcachedtool delete --regex "/^post_2_(.*)$/"