The which command gives you the local path of it:
$ which redis-cli
/usr/bin/redis-cli
And, if you are using a Debian based distro, you can combine it with dpkg to figure it out from which package does it comes from:
$ dpkg -S `which redis-cli`
redis-tools: /usr/bin/redis-cli
Top comments (5)
if
whichreturns empty result – try thetype, and then you may see that the command could be an aliasSome more useful commands:
whereis,whatisDemo:
Another tip is that you can use
command -vinstead ofwhich. It's slightly less memorable, but it should work on every system you use;whichmight not.If you use PowerShell, the equivalent is
where.I'd suggest using
command -vinstead ofwhichas it's more portable. Also using$(...)instead of backticks in general, so:dpky -S $(command -v redis-cli)because it's usually easier to use this kind of substitution. For one thing, you can nest it, and if you end up using it for some things, then using it for everything makes sense, right?
Whaaaaaat 🤯