In an erlang shell we can get process information by calling i().
The function i() obtains a pid list by calling erlang:processes/0. Then it calls erlang:process_info/1 on each pid.
The function erlang:process_info/1 provides some information about a process.
After that these fields along with the process id are formated into a table and then written to stdout.
[C,_,_] = [list_to_integer(S) || S <- string:tokens(B,[$.])].
Then C is always 0 for a local process and greater than 0 for a remote pid.
To show all registered processes, use the function regs(). This function prints registered ports too.
The function regs() gets a list of registered process names by calling erlang:registered(). Then it calls erlang:whereis/1 to translate each name into a pid. The remaining job is almost the same as i(), but regs() also collects information of ports by using erlang:port_info/1. There is a distributed version of regs, say nregs(), just as ni() to i().