Image

Knowledge base → Working with Processes in Linux

[Virtual servers]
Date of publication: 08.10.2023

To work with processes, we will provide several frequently used commands. With their help, you can search, filter by type, and also force their completion.

1. To view the list of processes

ps aux

2. To search for a process by name, where nginx is the process we are interested in

ps aux | grep nginx

2.1 Having found out the PID of a process, we can get detailed information about it, in our example 542

lsof -p 542

2.2 Displaying a list of processes using tcp ports

lsof -nP -iTCP -sTCP:LISTEN

2.3 Finding a process that occupies a specific port, in our example 443

lsof -nP -iTCP:443 -sTCP:LISTEN

3. Ending the process

3.1 To terminate a process by name, use the command where nginx is the process name

killall nginx

3.2 Force termination of a process by PID, in our case 473, where 9 is the maximum priority

kill -9 473




No Comments Yet