How do I find which package a command came from, Ubuntu 20.04 LTS
by Zarniwoop79 from LinuxQuestions.org on (#5NJ8P)
I'm using Kubernetes in my job, and the OS image that's being used contains very few commands, so I have to install them each time. But some basic commands are usually preinstalled so I don't know which package they came from, e.g. ping, tcpdump, telnet etc.
So I was wondering if anyone knows of a good way to find which package a command came from? On the Kubernetes image, just typing the command and pressing enter doesn't give suggestions like it does in a regular Ubuntu-installation, and on my laptop, the command is usually already present.
I found some suggestions for e.g. "dpkg -S ping", which sort of works, but it seems to give a wildcard-match so it lists anything that contains "ping". I've also seen suggestions where you put the full path, e.g. "/usr/bin/ping", but on my laptop (Ubuntu 20.04 LTS), that doesn't give any matches)
But what I would really like is a command that only matches on the exact command. Does anyone know how to do that?
So I was wondering if anyone knows of a good way to find which package a command came from? On the Kubernetes image, just typing the command and pressing enter doesn't give suggestions like it does in a regular Ubuntu-installation, and on my laptop, the command is usually already present.
I found some suggestions for e.g. "dpkg -S ping", which sort of works, but it seems to give a wildcard-match so it lists anything that contains "ping". I've also seen suggestions where you put the full path, e.g. "/usr/bin/ping", but on my laptop (Ubuntu 20.04 LTS), that doesn't give any matches)
But what I would really like is a command that only matches on the exact command. Does anyone know how to do that?