You are on page 1of 23

7/29/13

12 TOP Command Examples in Linux

Advertise Hire Us Submit Articles Archives Who We Are? Contact Us Privacy Policy Copyright Policy
Search

Home Linux Distros Open Source Web Servers Databases Linux Commands

TecMint.com is a community driven Linux website. Our motto is to provide an effortless howtos to our
valuable readers.
You are also welcome to join our community and can be part of our team, contributing and submitting well written article on Linux. If you have any query,
www.tecmint.com/12-top-command-examples-in-linux/ 1/23

7/29/13

12 TOP Command Examples in Linux

please contact us by email tecmint.com [at] gmail [dot] com or use our contact form.

12 TOP Command Examples in Linux


By Ravi Saive Under: CentOS, Fedora, Linux Commands, Linux Distros, RedHat On: March 4, 2013
Linux CPU Linux Box Linux Tools Linux Help

This is the part of our on-going series of commands in Linux. We have covered basic ls command and cat command. In this article, we are trying to explore top command which is one of the most frequently used commands in our daily system administrative jobs. top command displays processor activity of your Linux box and also displays tasks managed by kernel in real-time. Itll show processor and memory are being used and other information like running processes. This may help you to take correct action. top command found in UNIX-like operating systems.

Linux Top Command Examples You might also be interested in following tutorials : 1. Htop (Linux Process Monitoring) tool for RHEL, CentOS & Fedora 2. Iotop (Monitor Linux Disk I/O) in RHEL, CentOS and Fedora 1. Display of Top Command In this example, it will show information like tasks , memory, cpu and swap. Press q to quit window.
www.tecmint.com/12-top-command-examples-in-linux/ 2/23

7/29/13

12 TOP Command Examples in Linux

#t o p

Linux Top Command 2. Sorting with -O (Uppercase Letter O). Press (Shift+O) to Sort field via field letter, for example press a letter to sort process with PID (Process ID).

www.tecmint.com/12-top-command-examples-in-linux/

3/23

7/29/13

12 TOP Command Examples in Linux

Sorting Process IDs with Top Type any key to return to main top window with sorted PID order as shown in below screen. Press q to quit exit the window.

www.tecmint.com/12-top-command-examples-in-linux/

4/23

7/29/13

12 TOP Command Examples in Linux

Sorting Process IDs 3. Display Specific User Process Use top command with u option will display specific User process details.
#t o put e c m i n t

www.tecmint.com/12-top-command-examples-in-linux/

5/23

7/29/13

12 TOP Command Examples in Linux

Top with Specific User Processes 4. Highlight Running Process in Top Press z option in running top command will display running process in color which may help you to identified running process easily.

www.tecmint.com/12-top-command-examples-in-linux/

6/23

7/29/13

12 TOP Command Examples in Linux

Top Process with Colorful 5. Shows Absolute Path of Processes Press c option in running top command, it will display absolute path of running process.

www.tecmint.com/12-top-command-examples-in-linux/

7/23

7/29/13

12 TOP Command Examples in Linux

Top with Specific Process Path 6. Change Delay or Set Screen Refresh Interval in Top By default screen refresh interval is 3.0 seconds, same can be change pressing d option in running top command and change it as desired as shown below.

www.tecmint.com/12-top-command-examples-in-linux/

8/23

7/29/13

12 TOP Command Examples in Linux

Top Set Refresh Time 7. Kill running process with argument k You can kill a process after finding PID of process by pressing k option in running top command without exiting from top window as shown below.

www.tecmint.com/12-top-command-examples-in-linux/

9/23

7/29/13

12 TOP Command Examples in Linux

Top Kill Process ID 8. Sort by CPU Utilisation Press (Shift+P) to sort processes as per CPU utilization. See screenshot below.

www.tecmint.com/12-top-command-examples-in-linux/

10/23

7/29/13

12 TOP Command Examples in Linux

Top High CPU Utilization 9. Renice a Process You can use r option to change the priority of the process also called Renice.

www.tecmint.com/12-top-command-examples-in-linux/

11/23

7/29/13

12 TOP Command Examples in Linux

Top Renice Process 10. Save Top Command Results Press (Shift+W) to save the running top command results under /root/.toprc.

www.tecmint.com/12-top-command-examples-in-linux/

12/23

7/29/13

12 TOP Command Examples in Linux

Top Command Save Results 11. Getting Top Command Help Press h option to obtain the top command help.

www.tecmint.com/12-top-command-examples-in-linux/

13/23

7/29/13

12 TOP Command Examples in Linux

Top Command Help 12. Exit Top Command After Specific repetition Top output keep refreshing until you press q. With below command top command will automatically exit after 10 number of repetition.
#t o pn1 0

There are number of arguments to know more about top command you may refer man page of top command. Please share it if you find this article useful through our comment box below.
Bio Latest Posts
14/23

www.tecmint.com/12-top-command-examples-in-linux/

7/29/13

12 TOP Command Examples in Linux

Ravi Saive
Owner at TecM int.com

Simple Word a Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux.

Linux Services & Free WordPress Setup

Our post is simply DIY aka Do It Yourself, still you may find difficulties and want us to help you out. We offer wide range of Linux and Web Hosting Solutions at fair minimum rates. Please submit your orders by Clicking Here.

Tw eet

936
Like

10

0
Share

8
www.tecmint.com/12-top-command-examples-in-linux/ 15/23

7/29/13

12 TOP Command Examples in Linux

comments
Home alarm system Daily Internet Connection Windows Advertising Be Change Dedicated Hosting Facebook Profile

My facebook profile

Previous Post How to Get Hardware Information with Dmidecode Command on Linux Next Post A Basic Guide to Different Stages of Linux Boot Process

Related Post(s):
1. 2. 3. 4. 5. 6. Install NetBeans IDE 7.2 in RHEL/CentOS 6.3/5.8 and Fedora 18-12 8 Pratical Examples of Linux Touch Command CentOS 6.3 Step by Step Installation Guide with Screenshots 18 Tar Command Examples in Linux 25 Hardening Security Tips for Linux Servers 5 Best Practices to Secure and Protect SSH Server
Linux Tools Linux Help Unix Fedora

8 Responses

1.

Victor Ostorga says: August 28, 2012 at 7:55 pm There is a typo in Kill running process with argument d . It must be k Reply

www.tecmint.com/12-top-command-examples-in-linux/

16/23

7/29/13

12 TOP Command Examples in Linux

Ravi Saive says: August 28, 2012 at 9:47 pm @Victor Ostorga, Thanks for pointing out, corrected now. Reply 2. Ashokkumar says: September 17, 2012 at 6:45 pm Thanks. Nice tutorial. I m recently joined as system engineer. Actually I dont know what top command performs, i have followed what you did in the screen. I got same result. Can you explain what is the purpose of this command? How do I identify any wrong(process) in the terminal? Thanks Reply Ravi Saive says: September 17, 2012 at 6:55 pm @AshokKumar the top command is used to monitor real time running processes in Linux. It is used to identify which processes is utilizing high CPU or memory usage. so you can kill that process with top command as we mentioned above. Reply 3. Ravi says:
17/23

www.tecmint.com/12-top-command-examples-in-linux/

7/29/13

12 TOP Command Examples in Linux

February 4, 2013 at 6:47 pm I tried write the top results to file, but i am not able to read the data, data is not well organised. Reply 4. Moosh says: March 13, 2013 at 6:25 pm I use htop Reply 5. gigi says: April 6, 2013 at 7:13 pm dont forget ps-aux Reply 6. ferdinandp says: June 18, 2013 at 11:36 pm htop here Reply

Leave a Reply
Name (Required) Mail (will not be published) (Required)

www.tecmint.com/12-top-command-examples-in-linux/

18/23

7/29/13

12 TOP Command Examples in Linux

Website

Submit Comment

Twitter 869 Twitter Facebook 11390 Facebook Google+ 281 Google+ RSS 1431 Subscribers Become A TecMint Subscriber to receive latest Updates.
Enter Your Email Address :)Signup!

www.tecmint.com/12-top-command-examples-in-linux/

19/23

7/29/13

12 TOP Command Examples in Linux

Popular Latest Comments Tags

Install Apache, MySQL 5.5.32 & PHP 5.5.0 on RHEL/CentOS 6.4/5.9 & Fedora 19-1288 Comments

Install Cacti (Network Monitoring) on RHEL/CentOS 6.3/5.8 and Fedora 17-1288 Comments

Wine 1.6 Released Install in RHEL, CentOS and Fedora85 Comments

CentOS 6.3 Step by Step Installation Guide with Screenshots71 Comments


www.tecmint.com/12-top-command-examples-in-linux/ 20/23

7/29/13

12 TOP Command Examples in Linux

Install Google Chrome 28.0 on RHEL/CentOS 6 and Fedora 19/1544 Comments

Install Skype 4.1 in Ubuntu 12.10, Xubuntu 12.10 and Linux Mint 14/1343 Comments

15 Command Line Tools to Monitor Linux Performance41 Comments

Install VirtualBox 4.2.16 on RHEL/CentOS 6.4/5.9 and Fedora 19-1236 Comments

CentOS 6.4 Step by Step Installation Guide with Screenshots36 Comments

Install Linux Malware Detect (LMD) in RHEL, CentOS and Fedora35 Comments

First Ubuntu Edge Hands-On VIDEO

www.tecmint.com/12-top-command-examples-in-linux/

21/23

7/29/13

12 TOP Command Examples in Linux

www.tecmint.com/12-top-command-examples-in-linux/

22/23

7/29/13

12 TOP Command Examples in Linux

2013Tecmint: Linux Howtos, Tutorials & Guides.All rights reserved. Proudly designed by Tecmint.com.
www.tecmint.com/12-top-command-examples-in-linux/ 23/23

You might also like