centos6下無法使用lsof命令"-bash: lsof: command not found"


1. 問題描述
在centos下, 無法使用命令lsof, 出現以下信息:
# lsof -i:3690  
-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:3690         (3690默認是svn服務端的端口)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM