'Count active processes in Linux Terminal

I'm looking for 2 Ubuntu terminal commands that will:

  1. Show currently running processes (or tasks).
  2. Count how many currently running processes (or tasks) there are.

I am windows user and I'm not sure if it's named tasks or processes, but I'm looking for the same thing that's displayed when I open windows task manager.



Solution 1:[1]

It's very easy using the ps utility. That will return a list of

  • PID: Process identification number.
  • TTY: The type of terminal the process is running on.
  • TIME: Total amount of CPU usage.
  • CMD: The name of the command that started the process.

You can also combine/pipe it with wc to count the lines produced by it, hence counting the number of processes, like this:

$ ps -e | wc -l

You can find more info here and here.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 rikyeah