So as the question suggests, I want to get the version of a command inside a bash script, instead of using the terminal. I know that all available commands are present as files inside the directory **/usr/bin**. But it does not give the versions and it gives some funny information when you use cat for one of the (command) files. for example - ```cat /usr/bin/man``` gives - [![funny output][1]][1] [1]: https://i.sstatic.net/WiDAL.png What is this and how do I get the version? I am using Ubuntu 20.04. I know its a stupid question to ask here but I wasn't able to find anything :/ **Edit - Love the answers but I think people misunderstood my question. I know you can get the version of a command - one way or another, but this works only in the interactive terminal.** ***I want to get the version inside a shell script instead.***