LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to get an application name from its binaries Linux, Solaris, HPUX (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-get-an-application-name-from-its-binaries-linux-solaris-hpux-4175599991/)

ohijames 02-17-2017 09:29 AM

How to get an application name from its binaries Linux, Solaris, HPUX
 
Hi,

Please, is it possible? or is there a command one can use to get an application name/vendor from its binaries in Linux, Solaris and HPUX.

I had a situation once where sudo was installed on OEL 5 and anytime I ran "rpm - qa | grep sudo" it didn't return anything even though the binaries existed. I later found out that the rpm database was corrupt and had to fix it for it to work properly.

I am wondering if there is any other thorough process of checking binaries to know if an application is installed and possibly return the application

I will also like to get the vendor name for example there is sudo from Quest and thee is sudo from www.sudo.ws. I will like to be able to differentiate between these for my script to work

Thanks,
O

rtmistler 02-17-2017 09:40 AM

Not sure about sudo, however you can get the version or help on most commands using either --help --version, -h -v, /h /v, or /help /version. There should be some form of command line switches you can use to obtain this information.

szboardstretcher 02-17-2017 09:42 AM

Sure. You can use yum to find out what package it came from, then use rpm -Va to verify the contents of the package.

If something has changed (md5sum, permissions, etc) it will report the change/difference.

For example, if I change nano then check it, i get this:

Quote:

[root@tools ~]# which nano
/usr/bin/nano
[root@tools ~]# > /usr/bin/nano
[root@tools ~]# rpm -Va nano
S.5....T. /usr/bin/nano

chrism01 02-20-2017 03:29 AM

If you want to avoid the pkg mgr, you could use 'find' and 'strings' .
Possibly also 'od' .

nodir 02-20-2017 07:03 AM

Not sure if that is what you ask for:
"which(1) is an external program used to search PATH for an executable. It behaves differently on different systems and you can't rely on a useful exit code; use (from most to least portable) ''command -v'' or ''type -P'' (to find the path) or ''hash'' (to check) instead. See http://mywiki.wooledge.org/BashFAQ/081"
And there is also "whereis"


All times are GMT -5. The time now is 09:02 AM.