- 论坛徽章:
- 0
|
Solaris Command - lsof
lsof lists information about files that are open by the process running on a Unix system.
Defaultly, SMClsof not installed when Solaris installed, you have to install SMClsof manually.You can download lsof pkg from
www.sunfreeware.com
.
The version I used is 4.77
lsof filename
-indicates which process works on the file
lsof -c commad
-show files open by the command
lsof -g gid
-show files open by users with gid
lsof -p pid
-show files open by the pid
lsof -u username
- show files open by the user
lsof +d/+D dir
- +d show files open in current dir
- +d show files open in current and sub dirs
lsof -i[46] [protocol][@hostname|hostaddr][:service|port]
-show process with network information
Some examples from blogs:
(1)unmount:/mountpoint: Device is busy
lsof /mountpoint
You would see processes open files in the mountpint, and kill them.
(2)List connected processes with remote ip
lsof
-i@10.1.20.21
You would see all connected processes to 10.1.20.21
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/70217/showart_715394.html |
|