If you are facing command not found error for lsof command, here is the required steps to install it.
Note: You have to have root access to install this command.
Code:
[root@devopsrun1 ~]# lsof
-bash: lsof: command not found
Installing LSOF using yum
Code:
[root@devopsrun1 ~]# yum install lsof
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: xxxxx
* extras: xxxxxxxxxx
* updates: xxxxxxxxxxxxx
base                                                                                                              | 3.6 kB  00:00:00
extras                                                                                                            | 2.9 kB  00:00:00
updates                                                                                                           | 2.9 kB  00:00:00
(1/2): extras/7/x86_64/primary_db                                                                                 | 165 kB  00:00:00
(2/2): updates/7/x86_64/primary_db                                                                                | 7.6 MB  00:00:07
Resolving Dependencies
--> Running transaction check
---> Package lsof.x86_64 0:4.87-6.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================================
Package                       Arch                            Version                               Repository                     Size
=========================================================================================================================================
Installing:
lsof                          x86_64                          4.87-6.el7                            base                          331 k

Transaction Summary
=========================================================================================================================================
Install  1 Package

Total download size: 331 k
Installed size: 927 k
Is this ok [y/d/N]: y
Downloading packages:
lsof-4.87-6.el7.x86_64.rpm                                                                                        | 331 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : lsof-4.87-6.el7.x86_64                                                                                                1/1
  Verifying  : lsof-4.87-6.el7.x86_64                                                                                                1/1

Installed:
  lsof.x86_64 0:4.87-6.el7

Complete!