如何查看像"lsof -l"这样的文件句柄? [英] How to see file handles like with "lsof -l"?

查看:235
本文介绍了如何查看像"lsof -l"这样的文件句柄?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我执行了以下命令():

I did the commands (source):

$ exec 3>/tmp/thirdfile
$ exec 4>/tmp/fourthfile
$ echo drib >&3
$ echo drab >&4
$ echo another drib >&3
$ echo another drab >&4
$ exec 3>&-
$ exec 4>&-

如何查看文件句柄(类似于lsof -l)?

How can I see the file handles, something like with lsof -l?

推荐答案

我不明白,为什么不只使用lsof:

I don't understand, why not just use lsof:

lsof -p $$

$$是一个shell变量,用于保存shell的进程ID

$$ being a shell variable that holds the shell's process ID

您还可以将文件描述符限制为:

You can also limit to just file descriptors like:

lsof -a -d0-65535 -p $$

这篇关于如何查看像"lsof -l"这样的文件句柄?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆