How to install lsof tools under Linux
This article mainly shows you "how to install lsof tools under Linux", the content is simple and easy to understand, organized clearly, I hope to help you solve doubts, let Xiaobian lead you to study and learn "how to install lsof tools under Linux" this article bar.
Lsof is a system management/security Uber tool. Calling this tool lsof is true because it means "lists open files." One thing to remember, though, is that everything in Unix (including network sockets) is a file.
image-20211121184204192 Step
1. Download the installation package
https://dl.packetstormsecurity.net/UNIX/IDS/lsof/lsof_4.76.tar.gz or https://download.csdn.net/download/songzehao/11826832
In addition, attached a source package download site http://www.verysource.com/, some of the command to find the installation package can try your luck here.
Second, extract the installation package
tar -zxvf lsof_4.76.tar.gz
Third, extract the source code package
cd lsof_4.76tar -xvf lsof_4.76_src.tar
IV. Compile source code
cd lsof_4.76_src./ Configure linuxmake
V. Inspection and installation
After compiling, you can see that there is already a ***lsof*** command,
img
Then check whether the installation is successful, try to run it under the source decompression directory,
[root@BI-APPSERVER003 lsof_4.76_src]# ./ lsof -i:8808COMMAND PID USER FD TYPE DEVICE SIZE NODE NAMEjava 14890 root 21u IPv4 30273893 TCP *:8808 (LISTEN)
5. Create links (shortcuts)
ln -s /root/songzehao/lsof_4.76/lsof_4.76_src/lsof /usr/bin
You can now run ***lsof*** anywhere.
The above is "How to install lsof tool under Linux" all the contents of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!