![通过终端获取程序的PID](https://linux22.com/image/1121298/%E9%80%9A%E8%BF%87%E7%BB%88%E7%AB%AF%E8%8E%B7%E5%8F%96%E7%A8%8B%E5%BA%8F%E7%9A%84PID.png)
我想通过终端获取正在运行的程序的 PID。我在这里和 Google 上搜索过,但没有找到如何做到这一点。哪个命令可以给我正在运行的进程的 PID?
答案1
pidof <insert process name>
前任:
user@localhost:~$ pidof firefox
31838
答案2
答案3
考虑使用top
终端中的命令。
The top program provides a dynamic real-time view of a running
system. It can display system summary information as well as a
list of processes or threads currently being managed by the Linux
kernel. The types of system summary information shown and the
types, order and size of information displayed for processes are
all user configurable and that configuration can be made persis‐
tent across restarts.
通过男士上衣