Top Command in Linux
What is Top Command in Linux
Definition: Top command is use for to monitor the processes in Linux operating system, actually top is a task manager similar to windows operating system. Top is most useful system administrative command to monitor the process. The top command is use to view the real time process of the system. Their are different version of top in different operating system.Top in Unix version was written by William LeFebvre since 1984, in Linux top is procps-ng group of tools that was written by Roger Binns, in solaris top is prstat program and in windows top is a task manager.
By the use of top command in Linux Operating System user's can view the real time process PID, USER, PR, NI, VIRT, RES, SHR, %CPU, %MEM, TIME and Command, detail information of each are mention below.
PID: PID is a process id of each running task. The task may be audit, snmp and etc.
USER: User is shows the all users that is owner or custodian of the running process.
PR: PR is the priority of the task means process.
NI: NI is shows the Nice Value of task. The negative nice value means the higher priority, and the positive nice value means the lower priority of the process (task).
VIRT: VIRT is shows the total virtual memory of the machine that is used by the process (task).
RES: RES is shows the resident size of actual physical memory that each process is consume.
SHR: SHR is shows the amount of shared memory size (kb) that is used by the process (task).
%CPU: The %CPU is shows the CPU usage of the running process (task).
%MEM: %MEM is shows the Shows the Memory usage of the process (task).
TIME+: Time+ is shows the consumption of CPU time (+ mean hundredths),It shows the total time that has been consumed till, when the process was started by specific user.
Command: Command is shows the command of each process (task). In top command, press c to give the detail path of command.
Most useful administrative command of "top" are as follows.
- To view the specific user process (task), type the below mention command.
top -u owais
- To save the result of top command, type the below mention command. Here top.txt is the file name that will save on provide path.
top -n 1 -b > top.txt
- To monitor the processes by use of top command for certain seconds, type the below mention command.
top -n 5
Note: 5 is a seconds.
- To check the version of top command in Linux base operating system, type the below mention command.
- To view the top command from last close state, type the below mention command.
- To monitor the processes by use of top command in secure mode, type the below mention command.
- Change the top command process refresh interval, press key "d" during the running top command. By-default during the running top command process refresh interval is 3 seconds.
- To view the running process (task) in color, press key "z" during the running top command.
- To view the complete path of the running process, press key "c" during the running top command. The complete path will shows in the column of "command".
- To kill the running process by use of PID (Process ID), press key "k" during the running top command and provide the process id.
- To view the high value of CPU consumption first, press keys "shift+P" during the running top command.
- To change the priority of the process means renice (negative nice to positive nice or positive nice to negative nice) the process, press key "r" during the running top command and provide the process id.
Thanks to read this Article