cubuntuncurses

What exactly are the "tasks" displayed in the top command output and where to find them?


So i am currently working on my own implementation of the top command using the ncurses and the Ubuntu system files and I have been wondering what exactly are the tasks it shows.

I did understand that they are the processes running on the device but i am looking for the Ubuntu folder where i can see this total numbers of tasks or the different tasks running.


Solution

  • Basically the folder you are looking is: /proc, and it's helpful to read this site.

    When you browsing man page of top, it's recommend to check the "See also" and check the gitlab repository of procps, the source code of top resides in it.

    At the line 5808 in file src/top/top.c, you can see an action to open the file under /proc, maybe you could check that for more detail.