linux记录(二)——centos7下无法使用lsof命令“-bash: lsof: command not found“

1. 问题描述
在centos下, 无法使用命令lsof, 出现以下信息:
# lsof -i:5672
-bash: lsof: command not found 
2. 解决方法
我们可以通过yum来安装:
# yum install lsof
# yum install lsof  
Loaded plugins: fastestmirror  
Setting up Install Process  
Loading mirror speeds from cached hostfile  
 * base: mirrors.163.com  
 * epel: ftp.cuhk.edu.hk  
 * extras: mirrors.aliyun.com  
 * updates: mirrors.163.com  
Resolving Dependencies  
--> Running transaction check  
---> Package lsof.x86_64 0:4.82-4.el6 will be installed  
--> Finished Dependency Resolution  
  
Dependencies Resolved  
  
================================================================================  
 Package         Arch              Version                Repository       Size  
================================================================================  
Installing:  
 lsof            x86_64            4.82-4.el6             base            319 k  
  
Transaction Summary  
================================================================================  
Install       1 Package(s)  
  
Total download size: 319 k  
Installed size: 890 k  
Is this ok [y/N]: y  
Downloading Packages:  
lsof-4.82-4.el6.x86_64.rpm                               | 319 kB     00:00       
Running rpm_check_debug  
Running Transaction Test  
Transaction Test Succeeded  
Running Transaction  
  Installing : lsof-4.82-4.el6.x86_64                                       1/1   
  Verifying  : lsof-4.82-4.el6.x86_64                                       1/1   
  
Installed:  
  lsof.x86_64 0:4.82-4.el6                                                        
  
Complete!
3. lsof 的常用几个命令
lsof -i:(端口号)  
如:
lsof -i:3306         (3306默认是mysql服务端的端口)
lsof -i:5672        (5672默认是rabbitmq服务端的端口)
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

RemainderTime

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值