The Prime Command Tutorial With Examples For Novices


Get real time updates directly on you device, subscribe now.

As a Linux administrator, you might want to wish to know some fundamental particulars of your Linux system, such because the at present operating processes, common system load, cpu and reminiscence utilization and so on., in some unspecified time in the future. Fortunately, we’ve a command line utility known as “high” to get such particulars. The highest command is a widely known and most generally used utility to show dynamic real-time details about operating processes in Unix-like working techniques. On this temporary tutorial, we’re going to see some widespread use circumstances of high command.

Prime Command Examples

Monitor all processes

To start out monitoring the operating processes, merely run the highest command with none choices:

$ high

Pattern output:

top command 1

Monitor operating processes utilizing Prime command

As you see within the above screenshot, high command shows the checklist of processes in a number of columns. Every column shows particulars equivalent to pid, consumer, cpu utilization, reminiscence utilization. Other than the checklist of processes, additionally, you will see the temporary stats about common system load, variety of duties, cpu utilization, reminiscence utilization and swap utilization on the highest.

Right here is the reason of the parameters talked about above.

PID – Course of id of the duty.
USER – Username of the the duty’s proprietor.
PR – Precedence of the duty.
NI – Good worth of the duty. If the great worth is unfavorable, the method will get increased precedence. If the great worth is constructive, the precedence is low. Refer this information to know extra about good.
VIRT – Whole quantity of digital reminiscence utilized by the duty.
RES – Resident Reminiscence Dimension, the non-swapped bodily reminiscence a job is at present utilizing.
SHR – Shared Reminiscence Dimension. The quantity of shared reminiscence utilized by a job.
S – The standing of the method (S=sleep R=operating Z=zombie).
%CPU – CPU utilization. The duty’s share of the elapsed CPU time for the reason that final display screen replace, expressed as a share of whole CPU time.
%MEM – Reminiscence Utilization. A job’s at present resident share of obtainable bodily reminiscence.
TIME+ – Whole CPU time utilized by the duty because it has began, exact to the hundredths of a second.
COMMAND – Title of the operating program.

Show path of processes

If you wish to see absolutely the path of the operating processes, simply press ‘c’. Now you will note the precise path of the applications beneath the COMMAND column within the under screenshot.

top command 2

Monitor processes owned by a particular consumer

For those who run high command with none choices, it’s going to checklist all operating processes owned by all customers. How about displaying processes owned by a particular consumer? It’s straightforward! To indicate the processes owned by a given consumer, for instance sk, merely run:

$ high -u sk
top command 3

Present operating processes owned by a particular consumer

Don’t present idle/zombie processes

As an alternative of viewing all processes, you may merely ignore the idle or zombie processes. The next command won’t present any idle or zombie processes:

$ high -i

Monitor processes with PID

If you already know the PID of any processes, for instance 21180, you may monitor that course of utilizing -p flag.

$ high -p 21180

You possibly can specify a number of PIDs with comma-separated values.

Monitor processes with course of identify

I don’t know PID, however know solely the method identify. Methods to monitor it? Easy!

$ high -p $(pgrep -d ‘,’ firefox)

Right here, firefox is the method identify and ‘pgrep -d’ picks the respective PID from the method identify.

Show processes by CPU utilization

Typically, you may wish to show processes sorted by CPU utilization. In that case, use the next command:

$ high -o %CPU

top command 4

The processes with increased CPU utilization can be displayed on the highest. Alternatively, you kind the processes by CPU utilization by urgent SHIFT+p.

Show processes by Reminiscence utilization

Equally, to order processes by reminiscence utilization, the command can be:

$ high -o %MEM

Renice processes

You possibly can change the precedence of a course of at any time utilizing the choice ‘r’. Run the highest command and press r and kind the PID of a course of to vary its precedence.

top command 8

Right here, ‘r’ refers renice.

Set replace interval

Prime program has an choice to specify the delay between display screen updates. If wish to change the delay-time, say 5 seconds, run:

$ high -d 5

The default worth is seconds.

For those who already began the highest command, simply press ‘d’ and kind delay-time and hit ENTER key.

top command 7

Set variety of iterations (repetition)

By default, high command will hold operating till you press q to exit. Nevertheless, you may set the variety of iterations after which high will finish. As an illustration, to exit high command robotically after 5 iterations, run:

$ high -n 5

Kill operating processes

To kill a operating course of, merely press ‘okay’ and kind its PID and hit ENTER key.

top command 5

Prime command helps few different choices as effectively. For instance, press ‘z’ to modify between mono and colour output. It should allow you to to simply spotlight operating processes.

top command 6

Press ‘h’ to view all accessible keyboard shortcuts and assist part.

To give up high, simply press q.

At this stage, you should have a fundamental understanding of high command. For extra particulars, refer man pages.

$ man high

As you may see, utilizing Prime command to watch the operating processes isn’t that tough. Prime command is straightforward to be taught and use!

And, that’s all for now. Extra good stuffs to come back. Keep tuned!


Thanks for stopping by!

Assist us that will help you:

Have a Good day!!

Source link

Leave A Reply

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More