We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lsof - list open files
在linux下everything is file, 所以lsof是利器。
nc -l 9999
lsof -i :9999
lsof -i :9999 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nc 19856 nonocast 3u IPv4 0x59c33e997832cee1 0t0 TCP *:distinct (LISTEN)
touch foo
tail -f foo
lsof foo
$ lsof foo COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME tail 19728 nonocast 3r REG 1,4 12 64987891 foo
lsof -p 3137 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME Evernote 3137 nonocast cwd DIR 1,4 320 53481396 /Users/nonocast/Library/Containers/com.evernote.Evernote/Data Evernote 3137 nonocast txt REG 1,4 13160208 10194243 /Applications/Evernote.app/Contents/MacOS/Evernote Evernote 3137 nonocast txt REG 1,4 75696 3958353 /Applications/Evernote.app/Contents/Frameworks/wav2gsm.framework/Versions/A/wav2gsm Evernote 3137 nonocast txt REG 1,4 436576 3958322 /Applications/Evernote.app/Contents/Frameworks/HockeySDK.framework/Versions/A/HockeySDK Evernote 3137 nonocast txt REG 1,4 435008 6139516 /Applications/Evernote.app/Contents/Frameworks/CocoaLumberjack.framework/Versions/A/CocoaLumberjack Evernote 3137 nonocast txt REG 1,4 42304 10194134 /Applications/Evernote.app/Contents/Frameworks/ENLogging.framework/Versions/A/ENLogging Evernote 3137 nonocast txt REG 1,4 221152 3958337 /Applications/Evernote.app/Contents/Frameworks/OpenIDAppAuth.framework/Versions/A/OpenIDAppAuth Evernote 3137 nonocast txt REG 1,4 6265584 10194076 /Applications/Evernote.app/Contents/Frameworks/CoreNote.framework/Versions/A/CoreNote Evernote 3137 nonocast txt REG 1,4 86528 10194065 /Applications/Evernote.app/Contents/Frameworks/CommEngine.framework/Versions/A/CommEngine
参考:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
lsof - list open files
在linux下everything is file, 所以lsof是利器。
通过
nc -l 9999
打开端口,然后用lsof -i :9999
查看占用情况通过
touch foo
创建文件, 然后tail -f foo
占用掉这个文件, 最后lsof foo
查看占用情况参考:
The text was updated successfully, but these errors were encountered: