Whois, whatis, which command not found – Install Whois Whatis which command

whois command not found on Linux Server – How to Install Whois Command

 

root@server [~]# whois globedrill.com
-bash: whois: command not found

 

whois command might not be installed on your linux server and that is the reason why you are getting the above error message. whois command is used on linux server to check the WHOIS information of the domain. To install this package you must have server root access.

How to install whois command on linux server

1. Login to your linux server via SSH as root user

2. Type the command “rpm -qa | grep whois” to check whether the package is installed

root@server [~]# rpm -qa | grep whois

OR

root@server [~]# rpm -qa | grep jwhois

If whois package is installed then it will show the below result.

root@server [~]# rpm -qa | grep whois
whois-5.1.1-2.el7.x86_64

3. Type “yum install whois” command to download and install whois package
 

root@server [~]# whois globedrill.com
-bash: whois: command not found

root@server [~]# yum install whois

–> Running transaction check
—> Package whois.x86_64 0:5.1.1-2.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

Total download size: 72 k
Installed size: 222 k
Is this ok [y/d/N]: y
Downloading packages:
whois-5.1.1-2.el7.x86_64.rpm | 72 kB 00:00:00

Installing : whois-5.1.1-2.el7.x86_64 1/1
Verifying : whois-5.1.1-2.el7.x86_64 1/1

Installed:
whois.x86_64 0:5.1.1-2.el7

Complete!
root@server [~]#

 
Now whois package is installed on the above server. On some linux distributions the package is different so you must install jwhois instead of whois package. “Yum install jwhois”

To uninstall/remove the whois package you should run the command “yum remove whois” on the server

 


whatis: command not found – How to Install whatis command on linux

root@server [~]# /usr/bin/whatis
-bash: /usr/bin/whatis: No such file or directory

OR

root@server [~]# whatis
-bash: whatis: command not found

Whatis command might not be installed on your server and that is the reason why you are getting this error.

How to install whatis command on linux server

1. Log into your CentOS/Redhat server via SSH as root

2. Type the command “rpm -qa | grep man-db” to check whether the package is installed or not

3. Install the package man-db using yum

Just type “yum install man-db” like shown below

 

root@server [~]# yum install man-db

Resolving Dependencies

—> Package man-db.x86_64 0:2.6.3-9.el7 will be installed
–> Finished Dependency Resolution

Total download size: 559 k
Installed size: 1.8 M
Is this ok [y/d/N]: y

Downloading packages:
man-db-2.6.3-9.el7.x86_64.rpm | 559 kB 00:00:00

Installing : man-db-2.6.3-9.el7.x86_64 1/1
Verifying : man-db-2.6.3-9.el7.x86_64 1/1

Installed:
man-db.x86_64 0:2.6.3-9.el7

Complete!

 
whatis command is successfully installed and you won’t see any errors.
 

root@server [~]# whatis -V
whatis 2.6.3
root@server [~]# whatis
whatis what?

 


which command not found – How to install which command on linux server

[root@server ~]# which php
-bash: /usr/bin/which: No such file or directory

OR

[root@server ~]# which php
-bash: which: command not found

which command is not installed on the above server and that is the reason why you’re getting the above error.

How to install which Command on Linux Server

1. Log into server via SSH as ‘root’ user

2. Type “rpm -qa | grep which” command to check whether which package is installed or not.

[root@server /]# rpm -qa | grep which
[root@server /]#

3. Run the command “yum install which” to install which package
 

[root@server /]# rpm -qa | grep which
[root@server /]# yum install which

—> Package which.x86_64 0:2.19-6.10.amzn1 will be installed
–> Finished Dependency Resolution

Total download size: 41 k
Installed size: 71 k
Is this ok [y/d/N]: y
Downloading packages:
which-2.19-6.10.amzn1.x86_64.rpm | 41 kB 00:00

Installing : which-2.19-6.10.amzn1.x86_64 1/1
Verifying : which-2.19-6.10.amzn1.x86_64 1/1

Installed:
which.x86_64 0:2.19-6.10.amzn1

Complete!

 
Which command is installed on the above server. Type to below command to confirm whether it is installed correctly.

[root@server /]# which php
/usr/local/bin/php