我想通过终端获取正在运行的程序的 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.
通过男士上衣