2. For example, if the process number is known as 12840, query its corresponding process.
ps? -q? 12840 Description: The -q parameter is a fast mode of ps. With this parameter, necessary process information can be quickly read from the pidlist. Followed by the process number, which is the pid number.
You can also use the following command to print only the command, that is, only the process name is displayed:
ps -q 12840 -o comm=
Description: -o indicates the output format, comm= that is, the output format only outputs comand, that is, only the process name is displayed.