Process Management Commands on RedHat 8 Linux

How Process Commands Works on RedHat 8/CentOS 8/RedHat 7/CentOS 7

Processing is a series of action to achieve a desire output that perform by the Central Processing Unit (CPU). Computers are communicate with each other and other devices by use of commands that is called Computer Processing. The Computer processing is an action of microprocessor that known as Central Processing Unit. The basic definition of Central Processing Unit (CPU) is a brain of Computer System to execute the instructions that instruct by application or program, the instruction first loaded on a Random Access Memory (RAM) then it is forward to the Central Processing Unit (CPU).

The Central Processing Unit (CPU) generally known as processor, Central Processing Unit (CPU) is integrated circuit chip that attach with motherboard in a computer that process the instructions. The Central Processing Unit (CPU) is use to perform arithmetic and logical I/O operations.

Three components of Central Processing Unit (CPU) are mention below.

  1. Arithmetic and Logical Unit.
  2. Registers.
  3. Control Unit.

Arithmetic and Logical Unit:

Arithmetic and Logical Unit is a part of Central Processing Unit (CPU). Actually, Central Processing Unit (CPU) contains digital circuits that perform Arithmetic and Logical Operations. The Arithmetic and Logic Operations perform in binary forms (1 and 0).

Registers:

The Registers is a part of Central Processing Unit (CPU). CPU registers contains a small set of data that include instructions and storage addresses.

Control Unit:

Control Unit of Central Processing Unit (CPU) instruct the memory and logic unit how to behave on program instructions.

Process Status (ps) Commands:

ps T - To stop the process temporarily.

ps Z - To terminate the process.

ps r - Process is scheduled but is not yet on a CPU.

ps S - Process is waiting for I/O and Process is at a prompt, needing user input.

ps -d - Process is uninterruptible waiting for a device to respond.

ps R - Process is executing a system call.

Control Use:

Control + z - To suspend the process hold control key then press z.

Control + c - To cancel the process hold control key then press c.

Control + \ - To dump the process hold control key then press back slash (\).

Process Commands:

To check current processes in detail. Type the below mention commands.

ps aux

process management commands on rhel 8

ps lax

commands for process management on redhat 8

To grep the specific process is running or not, type the below mention command.

ps -ef | grep kthreadd

process management commands on redhat linux 7

The “kthreadd” is a Kernel thread process that is use to manage hardware of machine. In above command “grep” is use to take specific process from all process.

To display the running job information, type below mention command.

ps -j

To find the running process job number, type the below mention command.

jobs

To restart the job process in background, type the below mention command.

bg (% job number)
bg %1

To kill the process by use of process id (PID), type the below mention command.

kill PID
kill 5555

To show the users logging with computer name, type the below mention command.

w

process management commands on redhat linux 7

In the above command, PCPU show a foreground process cpu consumption and JCPU show a background task and children process consumption.

To show specific user login system IP means from which system user has taken ssh/terminal , type the below mention command.

w -h -u root
how process work on redhat 7

To kill specific user login terminal process, type the below mention command. This command kill all the process except bash.

For Putty user

pkill -t pts/0                                                     

For Terminal user

pkill -t tty3

To kill specific user login terminal process, type the below mention command. This command kill all the process with bash.

For Putty user

pkill -SIGKILL -t pts/0

For Terminal user

pkill -SIGKILL -t tty3

To check the specific user process type the below mention command.

pgrep -l -u username
pgrep -l -u owais

To kill all the process of specific user, type the below mention command.

pkill -SIGKILL -u username
pkill -SIGKILL -u owais

Install process tree command to view all the child process with parent process, type the below mention command.

yum install psmisc

To view all the process tree of specific user, type the below mention command.

pstree -p username
pstree -p owais

To kill all child process except bash processes, type the below mention command.

pkill -P Parent-Process-PID
pkill -P 5646

To kill all child process with bash process, type the below mention command. Here only give bash process ID (PID)

pkill -SIGKILL -P 8391

To suspend the specific process “snmpd” by use of signal command, type the below mention command.

pkill -SIGSTOP snmpd

To resume the specific process “snmpd” by use of signal, type the below mention command.

pkill -SIGCONT snmpd

To terminate the process, type the below mention command.

pkill snmpd

or

kill -9 PID

or Forcefully kill process by PID (Process ID)

kill -9 1298

To count a process of specific user “root”, type the following command.

ps -U root | wc -l

how process commands work on redhat 7

To count the every process running as user “root” that real and effective ID, type the below mention command.

ps -U root -u root u | wc -l

commands for process management on redhat 7 linux

To count the process of specific application, type the below mention command. Here we count process of application “nginx”.

ps -C nginx | wc -l

Thanks for Read this Article






Comments