How to Find Process Name Using PID Number in Raspberry Pi?
There are several ways to find the process name using PID number, which are mentioned below:
Command 1
The first command on the list is the ls /proc command. The /proc files system contains information of directories for all the running processes in the Raspberry Pi. So, by listing the contents of /proc we can display a list of running processes with their PID numbers. From this list, you can compare the PID number and find the process with the desired PID number
Command 2
The second command on the list is the ps aux command, which displays the list of processes with their PID number, %mem (memory) and %cpu (CPU) usage. So, you can know which PID or process is utilizing the most amount of RAM and CPU:
By seeing the output of this command, you can also find the process name by looking for its PID number in the list:
Command 3
Another handy command which can be used to find process name using PID number in Raspberry Pi is the top command:
The top command list all the processes with their PID number and sorted in such a way that the processes with maximum CPU usage are listed at the top:
Command 4
Last but the most useful command to find process name using the PID number in Raspberry Pi is mentioned below:
Syntax
By using this command, you can simply use the PID number in the command and as an output the name of the process will display on the terminal
Examples
$ ps -p 1455 -o comm=
Conclusion
There are so many commands in the Raspberry Pi system that can help users to find out the process name by using the PID number. Some of the most important and useful commands are discussed in the article such as the top command, ps aux, ls /proc and other such commands. The output displays the PID number list with the processes’ names from which the user can find their desired process.