Skip to content
New issue

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: add Chinese translation #15490

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions pages.zh/common/lsof.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# lsof

> 列出打开的文件和相应的进程。
> 注意:列出其他人打开的文件需要 root 权限(或 sudo)。
> 更多信息:<https://manned.org/lsof>.

- 查找打开了给定文件的进程:

`lsof {{路径/到/文件}}`

- 查找打开了本地互联网端口的进程:

`lsof -i :{{端口}}`

- 仅输出进程 ID (PID):

`lsof -t {{路径/到/文件}}`

- 列出给定用户打开的文件:

`lsof -u {{用户名}}`

- 列出给定命令或进程打开的文件:

`lsof -c {{进程或命令的名称}}`

- 列出特定进程打开的文件(给定其 PID):

`lsof -p {{PID}}`

- 列出目录中打开的文件:

`lsof +D {{路径/到/目录}}`

- 查找正在监听本地 IPv6 TCP 端口的进程,不转换网络或端口号:

`lsof -i6TCP:{{端口}} -sTCP:LISTEN -n -P`
Loading