முக்கிய உள்ளடக்கத்திற்குச் செல்லவும்
eLearner.app
தொகுதி 5 · பாடம் 1 இன் 2பாடத்திட்டத்தில் 10/11~12 min
தொகுதி பாடங்கள் (1/2)

மேலாண்மை செயல்முறைகள் (ps மற்றும் கொலை)

In Linux, every running program is called a process. Each process is assigned a unique numeric identifier called a PID (Process ID). Understanding how to monitor and manage these processes is essential to keeping the system stable and performant.


Monitoring Processes: ps

The ps (process status) command displays a snapshot of current processes. By default, it only lists processes associated with the current user and the current terminal window.

For a full view of all processes running on the system, the BSD option combination aux is commonly used:

  • a: Shows processes for all users.
  • u: Displays the process owner and CPU/Memory resource usage.
  • x: Lists processes not associated with any terminal (like background services).
Bash
ps aux

The output of ps aux is a structured table showing important columns like USER, PID, %CPU, %MEM, and COMMAND (the command that started the process).


Terminating Processes: kill and killall

If a process stops responding or consumes too many resources, we can terminate it by sending a signal.

The kill Command

The kill command sends a signal to a process specified by its PID:

Bash
kill 2048       # Sends the SIGTERM (15) signal, requesting a clean shutdown
kill -9 2048    # Sends the SIGKILL (9) signal, forcing immediate termination

[!WARNING] Only use kill -9 as a last resort, as it doesn't allow the program to save data or close open files cleanly.

The killall Command

If you do not know the PID or want to terminate all processes of a program by name, you can use killall:

Bash
killall python  # Terminates all processes named 'python'

Try it yourself

Exercise 1: List all processes

உடற்பயிற்சி#linux.m5.l1.e1
முயற்சிகள்: 0ஏற்றுகிறது…

Display a full list of all running processes on the system using the 'aux' options.

எடிட்டரை ஏற்றுகிறது…
குறிப்பைக் காட்டு

Use the 'ps' command followed by the 'aux' option.

3 முயற்சிகளுக்குப் பிறகு தீர்வு கிடைக்கும்

Exercise 2: Terminate a process by PID

உடற்பயிற்சி#linux.m5.l1.e2
முயற்சிகள்: 0ஏற்றுகிறது…

Terminate the python process with PID 2048 using the 'kill' command.

எடிட்டரை ஏற்றுகிறது…
குறிப்பைக் காட்டு

Use 'kill' followed by the PID of the process (2048).

3 முயற்சிகளுக்குப் பிறகு தீர்வு கிடைக்கும்

Exercise 3: Terminate all processes by name

உடற்பயிற்சி#linux.m5.l1.e3
முயற்சிகள்: 0ஏற்றுகிறது…

Terminate all running processes associated with the program 'python' using the 'killall' command.

எடிட்டரை ஏற்றுகிறது…
குறிப்பைக் காட்டு

Use 'killall' followed by the program name, in this case 'python'.

3 முயற்சிகளுக்குப் பிறகு தீர்வு கிடைக்கும்