linux 查看进程正在使用目录
时间: 2023-09-18 10:10:43 浏览: 86
可以使用 `lsof` 命令来查看当前进程正在使用的文件和目录。
例如,要查看进程号为 1234 的进程正在使用的目录,可以使用以下命令:
```
lsof -p 1234 | grep "cwd"
```
其中,`cwd` 表示当前工作目录,也就是进程正在使用的目录。上述命令会输出类似于以下内容:
```
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
bash 1234 bob cwd DIR 0,25 4096 786444 /home/bob
```
其中,`/home/bob` 就是进程号为 1234 的进程正在使用的目录。
阅读全文
相关推荐













