linux系统使用lsof命令"-bash: lsof: command not found"
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
·
linux系统使用lsof命令"-bash: lsof: command not found"
在redhat系统下想使用lsof命令查看应用端口占用情况
[root@photo720 ~]# uname -a
Linux photo720 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@photo720 ~]# lsof -i:80
-bash: lsof: command not found
[root@photo720 ~]#
发现lsof命令使用不了,因为没有安装lsof
安装命令如下:
yum install -y lsof
[root@photo720 ~]# yum install -y lsof
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
base | 3.6 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/4): extras/7/x86_64/primary_db | 201 kB 00:00:00
(2/4): epel/x86_64/updateinfo | 992 kB 00:00:00
(3/4): epel/x86_64/primary_db | 6.7 MB 00:00:00
(4/4): updates/7/x86_64/primary_db | 4.2 MB 00:00:00
Determining fastest mirrors
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
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!
测试
[root@photo720 ~]# lsof -i:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
AliYunDun 3598 root 22u IPv4 3670184 0t0 TCP photo720:34692->100.100.30.25:http (ESTABLISHED)
nginx 14912 root 10u IPv4 2972890 0t0 TCP *:http (LISTEN)
nginx 14912 root 13u IPv4 3691002 0t0 TCP photo720:http->116.24.67.35:eli (ESTABLISHED)
nginx 23692 root 10u IPv4 2972890 0t0 TCP *:http (LISTEN)
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e
added ecosystem file for PM2 5 年前
5def40a3
Add host customization support for the NodeJS version 5 年前
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐


所有评论(0)