Task Manager-top command in Linux/Unix

Source: Internet
Author: User
Document directory
  • Process Information
  • How to end a process

Although the Job Manager in windows is not easy to use (I personally prefer process Explorer), it is also convenient to conveniently view processes, CPU, memory... it can also easily end the process.

There is no Linux in the graphical interface, or a command can be used to implement the Windows Task Manager function. This command is"Top", You can use top to sort and end processes.

The top command is a common performance analysis tool in Linux. It can display the resource usage of various processes in the system in real time. By default, the process list is refreshed in 5 seconds, so it is similar to the Windows Task Manager.

Current overall statistics of the system

The first five lines of the top command are the overall statistics of the system.

The first line is the task queue information, which is the same as the execution result of the uptime command. Eg.

Top-15:09:51 up 17 days, 4 Users, load average: 1.09, 3.39, 4.76

15:09:51Current Time
Up 17 days, 3: 38System running time, in the format of minutes
4 UsersCurrent Login User count
Load average: 1.09, 3.39, 4.76System load, that is, the average length of the task queue.
The three values are the average values from 1 minute, 5 minutes, and 15 minutes ago to the present.

Second and Third, information about the process and CPU. When multiple CPUs exist, the content may exceed two rows. Eg.

Task: 115 total, 1 running, 114 sleeping, 0 stopped, 0 zombie
CPU (s): 16.1% us, 2.0% Sy, 0.0% Ni, 79.5% ID, 1.4% wa, 0.0% hi, 1.0% Si

Tasks: 115 totalProcess count
1 runningNumber of Running Processes
114 sleepingSleep process count
0 stoppedNumber of stopped Processes
0 zombieNumber of zombie Processes
CPU (s): 16.1% usCPU usage percentage of user space
2.0% SYCPU usage of kernel space
0.0% NiCPU usage percentage of processes that have changed their priorities in the process space
79.5% IDIdle CPU percentage
1.4% waPercentage of CPU time waiting for Input and Output
0.0% hi
0.0% Si

Memory information of the last two behaviors. Eg.

Mem: 8169876 k total, 7686472 K used, 483404 K free, 35272 K Buffers
Swap: 4096532 k total, 160 K used, 4096372 K free, 2477532 K cached

Mem: 8169876 ktotalTotal physical memory
7686472 K usedTotal physical memory used
483404 K freeTotal idle memory
35272 K BuffersMemory Used as kernel Cache
Swap: 4096532 k totalTotal number of swap partitions
160 K usedTotal number of swap zones used
4096372 K freeTotal number of idle swap Areas
2477532 K cachedThe total number of buffer swap areas.

The content in the memory is swapped out to the swap zone and then into the memory, but the used swap zone has not been overwritten. This value is the size of the SWAp zone where the content already exists. When the corresponding memory is swapped out again, you do not have to write data to the swap zone.

Process Information

The details of each process are displayed at the bottom of the statistics area. First, let's take a look at the meaning of each column.

PID user PR Ni virt res shr s % CPU % mem time + command

Serial Number Column name meaning
PID process ID
Ppid parent process ID
Ruser realusername
User ID of the UID process owner
User: User Name of the process owner
Group Name of the group process owner
The terminal name of the TTY startup process. Processes not started from the terminal are displayed?
PR priority
Ninice value. A negative value indicates a high priority, and a positive value indicates a low priority.
P indicates the last CPU used, which is only meaningful in multiple CPU environments.
% Percentage of CPU time used since the last CPU update to the present
Total CPU time used by the time process, in seconds
Time + total CPU time used by the process, in the unit of 1/100 seconds
% Mem percentage of physical memory used by the Process
Total virtual memory used by the virt process, in KB. Virt = swap + Res
The swap size in the virtual memory used by the SWAp process, in KB.
The size of the physical memory used by the res process, Not swapped out, in KB. Res = code + Data
Physical memory occupied by code executable code, in KB
Physical memory occupied by parts other than the data executable code (Data Segment + stack), in KB
Size of SHR shared memory, in KB
Number of nflt page errors
The number of modified pages that the last time the data is written to the present.

S Process status.
D = uninterrupted sleep
R = run
S = sleep
T = tracking/stopping
Z = zombie Process

Command command name/command line
If the process is sleep, wchan displays the system function name in sleep.
Flags task flag. For more information, see sched. h.

Sort by specified Column

In top, you can set to sort by one item. By default, it is sorted by CPU usage,

M, (uppercase), sorted by memory usage

P, sort by CPU usage percentage

T, sorted by time/accumulative time.

How to end a process

Enter lettersK(Lower case), and then enter the PID you want to kill

Of course, you can also directly run the command, kill PID

Other top usage

For other top usage, you can enter "H" on the top interface to go to the top command help interface.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.