centos6.8下无法使用lsof命令"-bash: lsof: command not found"

男娘i 2021-07-16 18:52 615阅读 0赞
  1. 1. 问题描述
  2. centos下, 无法使用命令lsof, 出现以下信息:
  3. [plain] view plain copy
  4. # lsof -i:3690 -bash: lsof: command not found
  5. 2. 解决方法
  6. 我们可以通过yum来安装:
  7. [plain] view plain copy
  8. # yum install lsof
  9. 本人操作如下:
  10. [plain] view plain copy
  11. # 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!
  12. 3. lsof 的常用几个命令
  13. [plain] view plain copy
  14. lsof -i:(端口号)
  15. 如,
  16. lsof -i:3306 (3306默认是mysql服务端的端口)
  17. lsof -i:3690 (3690默认是svn服务端的端口)

发表评论

表情:
评论列表 (有 0 条评论,615人围观)

还没有评论,来说两句吧...

相关阅读

    相关 lsof命令

    lsof(list open files)是一个列出当前系统打开文件的工具。在linux环境下,任何事物都以文件的形式存在,通过文件不仅仅可以访问常规数据,还可以访问网络连接和

    相关 Lsof命令使用

    Lsof命令使用 1、lsof 简介 Lsof是遵从Unix哲学的典范,它只做一件事情,并且做的相当完美。以列出某个进程打开的所有文件信息。打开的文件可能是普通的文

    相关 lsof命令

    lsof命令用于查看你进程开打的文件,打开文件的进程,进程打开的端口(TCP、UDP)。找回/恢复删除的文件。 -i<条件>:列出符合条件的进程。(4、6、协议、:端