Show what is running in linux

How can I see what processes are running?

I use Ubuntu Server 10.10 and I would like to see what processes are running. I know that PostgreSQL is running on my machine but I can not see it with the top or ps commands, so I assume that they aren’t showing all of the running processes. Is there another command which will show all running processes or is there any other parameters I can use with top or ps for this?

3 Answers 3

-e Select all processes. Identical to -A.

Thus, ps -e will display all of the processes. The common options for «give me everything» are ps -ely or ps aux , the latter is the BSD-style. Often, people then pipe this output to grep to search for a process, as in xenoterracide’s answer. In order to avoid also seeing grep itself in the output, you will often see something like:

where foo is the process name you are looking for.

However, if you are looking for a particular process, I recommend using the pgrep command if it is available. I believe it is available on Ubuntu Server. Using pgrep means you avoid the race condition mentioned above. It also provides some other features that would require increasingly complicated grep trickery to replicate. The syntax is simple:

where foo is the process for which you are looking. By default, it will simply output the Process ID (PID) of the process, if it finds one. See man pgrep for other output options. I found the following page very helpful:

Источник

How to show active processes in Linux

In Linux, there are numerous ways to view running processes, including both graphical user interfaces ( GUI s) and command-line utilities.

For those using the GNOME desktop environment, the GNOME System Monitor is available, whereas KDE users can access the System Activity tool. However, universally available across Linux distributions and other Unix-based operating systems are the ps and top command-line utilities.

These command-line tools come pre-installed on most Linux systems and can be especially useful when managing remote systems via SSH.

Steps to check and list details of running processes in Linux:

$ ps PID TTY TIME CMD 1082 pts/0 00:00:00 bash 1102 pts/0 00:00:00 ps

By default, ps selects all processes with the same effective user ID (euid=EUID) as the current user and associated with the same terminal as the invoker. It displays the process ID (pid=PID), the terminal associated with the process (tname=TTY), the cumulated CPU time in [DD-]hh:mm:ss format (time=TIME), and the executable name (ucmd=CMD). Output is unsorted by default.

$ ps -aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 1.1 0.5 101160 10612 ? Ss 09:19 0:07 /sbin/init maybe-ubiquity root 2 0.0 0.0 0 0 ? S 09:19 0:00 [kthreadd] root 3 0.0 0.0 0 0 ? I< 09:19 0:00 [rcu_gp] root 4 0.0 0.0 0 0 ? I< 09:19 0:00 [rcu_par_gp] root 6 0.0 0.0 0 0 ? I< 09:19 0:00 [kworker/0:0H-kblockd] root 7 0.0 0.0 0 0 ? I 09:19 0:00 [kworker/0:1-events] root 9 0.0 0.0 0 0 ? I< 09:19 0:00 [mm_percpu_wq] root 10 0.0 0.0 0 0 ? S 09:19 0:00 [ksoftirqd/0] root 11 0.0 0.0 0 0 ? I 09:19 0:00 [rcu_sched] root 12 0.0 0.0 0 0 ? S 09:19 0:00 [migration/0] root 13 0.0 0.0 0 0 ? S 09:19 0:00 [idle_inject/0] root 14 0.0 0.0 0 0 ? S 09:19 0:00 [cpuhp/0] root 15 0.0 0.0 0 0 ? S 09:19 0:00 [kdevtmpfs] root 16 0.0 0.0 0 0 ? I< 09:19 0:00 [netns] root 17 0.0 0.0 0 0 ? S 09:19 0:00 [rcu_tasks_kthre] root 18 0.0 0.0 0 0 ? S 09:19 0:00 [kauditd] root 19 0.0 0.0 0 0 ? S 09:19 0:00 [khungtaskd] root 20 0.0 0.0 0 0 ? S 09:19 0:00 [oom_reaper] root 21 0.0 0.0 0 0 ? I< 09:19 0:00 [writeback] root 22 0.0 0.0 0 0 ? S 09:19 0:00 [kcompactd0] root 23 0.0 0.0 0 0 ? SN 09:19 0:00 [ksmd] root 24 0.0 0.0 0 0 ? SN 09:19 0:00 [khugepaged] root 116 0.0 0.0 0 0 ? I< 09:19 0:00 [kintegrityd] root 117 0.0 0.0 0 0 ? I< 09:19 0:00 [kblockd] root 118 0.0 0.0 0 0 ? I< 09:19 0:00 [blkcg_punt_bio] root 119 0.0 0.0 0 0 ? I< 09:19 0:00 [tpm_dev_wq] root 120 0.0 0.0 0 0 ? I< 09:19 0:00 [ata_sff] root 121 0.0 0.0 0 0 ? I< 09:19 0:00 [md] root 122 0.0 0.0 0 0 ? I< 09:19 0:00 [edac-poller] root 123 0.0 0.0 0 0 ? I< 09:19 0:00 [devfreq_wq] root 124 0.0 0.0 0 0 ? S 09:19 0:00 [watchdogd] root 127 0.0 0.0 0 0 ? S 09:20 0:00 [kswapd0] root 128 0.0 0.0 0 0 ? I< 09:20 0:00 [kworker/u257:0-hci0] root 129 0.0 0.0 0 0 ? S 09:20 0:00 [ecryptfs-kthrea] root 132 0.0 0.0 0 0 ? I< 09:20 0:00 [kthrotld] root 133 0.0 0.0 0 0 ? S 09:20 0:00 [irq/24-pciehp] root 134 0.0 0.0 0 0 ? S 09:20 0:00 [irq/25-pciehp] root 135 0.0 0.0 0 0 ? S 09:20 0:00 [irq/26-pciehp] root 136 0.0 0.0 0 0 ? S 09:20 0:00 [irq/27-pciehp] root 137 0.0 0.0 0 0 ? S 09:20 0:00 [irq/28-pciehp] root 138 0.0 0.0 0 0 ? S 09:20 0:00 [irq/29-pciehp] root 139 0.0 0.0 0 0 ? S 09:20 0:00 [irq/30-pciehp] root 140 0.0 0.0 0 0 ? S 09:20 0:00 [irq/31-pciehp] root 141 0.0 0.0 0 0 ? S 09:20 0:00 [irq/32-pciehp] root 142 0.0 0.0 0 0 ? S 09:20 0:00 [irq/33-pciehp] root 143 0.0 0.0 0 0 ? S 09:20 0:00 [irq/34-pciehp] root 144 0.0 0.0 0 0 ? S 09:20 0:00 [irq/35-pciehp] root 145 0.0 0.0 0 0 ? S 09:20 0:00 [irq/36-pciehp] root 146 0.0 0.0 0 0 ? S 09:20 0:00 [irq/37-pciehp] root 147 0.0 0.0 0 0 ? S 09:20 0:00 [irq/38-pciehp] root 148 0.0 0.0 0 0 ? S 09:20 0:00 [irq/39-pciehp] root 149 0.0 0.0 0 0 ? S 09:20 0:00 [irq/40-pciehp] root 150 0.0 0.0 0 0 ? S 09:20 0:00 [irq/41-pciehp] root 151 0.0 0.0 0 0 ? S 09:20 0:00 [irq/42-pciehp] root 152 0.0 0.0 0 0 ? S 09:20 0:00 [irq/43-pciehp] root 153 0.0 0.0 0 0 ? S 09:20 0:00 [irq/44-pciehp] root 154 0.0 0.0 0 0 ? S 09:20 0:00 [irq/45-pciehp] root 155 0.0 0.0 0 0 ? S 09:20 0:00 [irq/46-pciehp] root 156 0.0 0.0 0 0 ? S 09:20 0:00 [irq/47-pciehp] root 157 0.0 0.0 0 0 ? S 09:20 0:00 [irq/48-pciehp] root 158 0.0 0.0 0 0 ? S 09:20 0:00 [irq/49-pciehp] root 159 0.0 0.0 0 0 ? S 09:20 0:00 [irq/50-pciehp] root 160 0.0 0.0 0 0 ? S 09:20 0:00 [irq/51-pciehp] root 161 0.0 0.0 0 0 ? S 09:20 0:00 [irq/52-pciehp] root 162 0.0 0.0 0 0 ? S 09:20 0:00 [irq/53-pciehp] root 163 0.0 0.0 0 0 ? S 09:20 0:00 [irq/54-pciehp] root 164 0.0 0.0 0 0 ? S 09:20 0:00 [irq/55-pciehp] root 165 0.0 0.0 0 0 ? I< 09:20 0:00 [acpi_thermal_pm] root 166 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_0] root 167 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_0] root 168 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_1] root 169 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_1] root 171 0.0 0.0 0 0 ? I< 09:20 0:00 [ipv6_addrconf] root 183 0.0 0.0 0 0 ? I< 09:20 0:00 [kstrp] root 202 0.0 0.0 0 0 ? I< 09:20 0:00 [charger_manager] root 244 0.0 0.0 0 0 ? I< 09:20 0:00 [mpt_poll_0] root 245 0.0 0.0 0 0 ? I< 09:20 0:00 [mpt/0] root 246 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_2] root 247 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_2] root 248 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_3] root 249 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_3] root 250 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_4] root 251 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_4] root 252 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_5] root 253 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_5] root 254 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_6] root 255 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_6] root 256 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_7] root 257 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_7] root 258 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_8] root 259 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_8] root 260 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_9] root 261 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_9] root 262 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_10] root 263 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_10] root 264 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_11] root 265 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_11] root 266 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_12] root 267 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_12] root 272 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_13] root 276 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_13] root 278 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_14] root 279 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_14] root 280 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_15] root 281 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_15] root 282 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_16] root 283 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_16] root 284 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_17] root 285 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_17] root 286 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_18] root 287 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_18] root 288 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_19] root 289 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_19] root 290 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_20] root 291 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_20] root 292 0.0 0.0 0 0 ? I< 09:20 0:00 [cryptd] root 293 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_21] root 294 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_21] root 295 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_22] root 297 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_22] root 298 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_23] root 299 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_23] root 300 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_24] root 302 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_24] root 303 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_25] root 305 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_25] root 306 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_26] root 307 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_26] root 308 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_27] root 310 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_27] root 312 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_28] root 314 0.0 0.0 0 0 ? S 09:20 0:00 [irq/16-vmwgfx] root 315 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_28] root 316 0.0 0.0 0 0 ? I< 09:20 0:00 [ttm_swap] root 318 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_29] root 319 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_29] root 321 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_30] root 323 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_30] root 324 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_31] root 326 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_31] root 343 0.0 0.0 0 0 ? I 09:20 0:00 [kworker/u256:20-events_power_efficient] root 352 0.0 0.0 0 0 ? I 09:20 0:00 [kworker/u256:29-events_unbound] root 365 0.0 0.0 0 0 ? S 09:20 0:00 [scsi_eh_32] root 368 0.0 0.0 0 0 ? I< 09:20 0:00 [scsi_tmf_32] root 383 0.0 0.0 0 0 ? I< 09:20 0:00 [kworker/0:1H-kblockd] root 416 0.0 0.0 0 0 ? I< 09:20 0:00 [raid5wq] root 457 0.0 0.0 0 0 ? S 09:20 0:00 [jbd2/sda2-8] root 458 0.0 0.0 0 0 ? I< 09:20 0:00 [ext4-rsv-conver] root 531 0.0 0.7 49096 15800 ? S
Usage: ps [options] Basic options: -A, -e all processes -a all with tty, except session leaders a all with tty, including other users -d all except session leaders -N, --deselect negate selection r only running processes T all processes on this terminal x processes without controlling ttys Selection by list: -C command name -G, --Group real group id or name -g, --group session or effective group name -p, p, --pid process id --ppid parent process id -q, q, --quick-pid process id (quick mode) -s, --sid session id -t, t, --tty terminal -u, U, --user effective user id or name -U, --User real user id or name The selection options take as their argument either: a comma-separated list e.g. '-u root,nobody' or a blank-separated list e.g. '-p 123 4567' Output formats: -F extra full -f full-format, including command lines f, --forest ascii art process tree -H show process hierarchy -j jobs format j BSD job control format -l long format l BSD long format -M, Z add security data (for SELinux) -O preloaded with default columns O as -O, with BSD personality -o, o, --format user-defined format s signal format u user-oriented format v virtual memory format X register format -y do not show flags, show rss vs. addr (used with -l) --context display security context (for SELinux) --headers repeat header lines, one per page --no-headers do not print header at all --cols, --columns, --width set screen width --rows, --lines set screen height Show threads: H as if they were processes -L possibly with LWP and NLWP columns -m, m after processes -T possibly with SPID column Miscellaneous options: -c show scheduling class with -l option c show true command name e show the environment after command k, --sort specify sort order as: [+|-]key[,[+|-]key[. ]] L show format specifiers n display numeric uid and wchan S, --cumulative include some dead child process data -y do not show flags, show rss (only with -l) -V, V, --version display version information and exit -w, w unlimited output width --help display help and exit For more details see ps(1).
$ ps -aux | grep cpu root 9 0.0 0.0 0 0 ? I< 09:19 0:00 [mm_percpu_wq] root 14 0.0 0.0 0 0 ? S 09:19 0:00 [cpuhp/0] user 1110 0.0 0.0 6428 992 pts/0 S+ 09:32 0:00 grep --color=auto cpu
$ top top - 09:24:55 up 5 min, 1 user, load average: 0.11, 0.26, 0.15 Tasks: 220 total, 1 running, 219 sleeping, 0 stopped, 0 zombie %Cpu(s): 6.2 us, 0.0 sy, 0.0 ni, 93.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 1958.4 total, 1495.4 free, 191.2 used, 271.9 buff/cache MiB Swap: 2048.0 total, 2048.0 free, 0.0 used. 1608.7 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1 root 20 0 101160 10612 7988 S 0.0 0.5 0:07.05 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.02 kthreadd 3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp 4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par_gp 5 root 20 0 0 0 0 I 0.0 0.0 0:00.16 kworker/0:0-events 6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:0H-kblockd 7 root 20 0 0 0 0 I 0.0 0.0 0:00.24 kworker/0:1-events 8 root 20 0 0 0 0 I 0.0 0.0 0:00.00 kworker/u256:0-events_freezable_power_ 9 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu_wq 10 root 20 0 0 0 0 S 0.0 0.0 0:00.24 ksoftirqd/0 11 root 20 0 0 0 0 I 0.0 0.0 0:00.38 rcu_sched 12 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 13 root -51 0 0 0 0 S 0.0 0.0 0:00.00 idle_inject/0 14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0 15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs 16 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 netns 17 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_tasks_kthre 18 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kauditd 19 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd 20 root 20 0 0 0 0 S 0.0 0.0 0:00.00 oom_reaper 21 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 writeback 22 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kcompactd0 23 root 25 5 0 0 0 S 0.0 0.0 0:00.00 ksmd 24 root 39 19 0 0 0 S 0.0 0.0 0:00.00 khugepaged 26 root 20 0 0 0 0 I 0.0 0.0 0:00.01 kworker/u256:1-events_unbound 116 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kintegrityd 117 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kblockd 118 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 blkcg_punt_bio 119 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 tpm_dev_wq 120 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 ata_sff 121 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 md 122 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 edac-poller 123 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 devfreq_wq 124 root rt 0 0 0 0 S 0.0 0.0 0:00.00 watchdogd 127 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kswapd0 128 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/u257:0-hci0
Usage: top -hv | -bcEHiOSs1 -d secs -n max -u|U user -p pid(s) -o field -w [cols]

Источник

Check Running Process in Linux

Want to know what all processes are running on your systems? Here's how to get details of the running processes in Linux.

As a system administrator, you might need to check all the processes that are consuming your computer's resources.

To get the list of all the running processes, run the ps command with aux argument flags in the following fashion:

This will give you a list of all running processes by all users on your system. You may use grep to filter the process using a pattern.

Let's see about using it in detail. I'll also share other commands to show running processes in Linux.

ps command

The ps command is the standard command that most sysadmins use in a UNIX-like operating system.

There are several options that you can use with the ps command, but the set of options to use when you want a list of all processes is aux .

So, running the following command will show me all processes on my system:

Or, you can use the BSD-style syntax, which are still available in GNU ps

  • a : Display information about other users' processes as well as of the user's own (if the processes are connected to terminals i.e. daemons get excluded)
  • u : Display in a user readable format
  • x : Include processes that are not connected to a terminal i.e. include daemons

This will give you an incredibly long list of running processes that were running at the time of executing the ps command.

Most people, including me, pipe this output in grep to find a needle in the haystack.

$ ps aux | grep alacritty pratham 4653 0.1 0.0 596776 63856 ? RNsl Mar09 3:43 alacritty pratham 4974 0.0 0.0 592792 58892 ? SNsl Mar09 0:18 alacritty pratham 6287 0.0 0.0 590204 56308 ? SNsl Mar09 0:14 alacritty pratham 8241 0.0 0.0 585504 51956 ? SNsl Mar09 0:07 alacritty pratham 514536 0.0 0.0 18808 2572 pts/1 SN+ 13:56 0:00 /usr/bin/grep --color=auto alacritty

Notice how the grep command was also included in the output. This is because it also has 'alacritty' in the process name (as the argument).

Be wary of this behaviour [that grep will be included in the output] if you use it in a script.

The only difference between using ps aux and ps -A is that when you use ps aux , you can easily grep the user, or alternatively, use the -u option. Whatever works for you.

Let's see some other Linux commands to see running processes.

pgrep command

The pgrep command accepts a pattern to match and if there are any processes that match with the provided pattern, a process ID (PID) is returned to stdout.

Below is the syntax to use for pgrep command:

Let's say, for example, I want to see the PIDs of any process that have the name 'alacritty'. I would use the following command for that:

$ pgrep alacritty 4653 4974 6287 8241

As I ran that command, I got four PIDs indicating that four processes match with the pattern 'alacritty' and their PIDs are outputted to the stdout.

You can also use the -u flag (as opposed to u ) along with ps command to specify a particular user and filter out the results, making it easier to manage.

There might be multiple users on my computer using Vim, user pratham and root . If I want to filter processes and only want to see if pratham has an active Vim process or not, here is how I find it out.

$ ps -u pratham | grep vim 516525 pts/2 SNl+ 0:00 nvim

pstree command

The pstree command, as its name implies, shows a hierarchical view of parent processes and child processes.

partial output of pstree command

When run, the pstree will show a top-down, tree-like structure output of processes as shown in the picture above.

You can also note that the PID 1 is systemd, indicating that my Linux system uses systemd.

Since there is not much information about PID, user, start time, CPU usage etc, it is not exactly a "go-to" command. But it still helps to know which child process belongs to which parent process.

Use a system monitor

Any UNIX-like system will have a tool that you can use to monitor the usage of physical resources like CPU, RAM, Network etc.

A few tools that people prefer and are widely used are top , atop , htop and btop .

Here is the output of top command running on my computer. It shows information like total tasks, CPU and Memory usage.

picture of top command running

The atop command differs from top , obviously, but it also shows much more information about the processes like CPU, RAM usage, I/O etc.

picture of atop command running

The htop utility is a widely used resource monitoring utility to get a real-time bar of per-core CPU usage, RAM and swap.

picture of htop command running

Finally, btop is one of the newest addition to the system resource usage monitoring utilities. The best thing about it is that we get a history of CPU usage.

picture of btop command running

Conclusion

This article covers how you can view the processes running on your computer. And there are several methods of viewing it. But, the most preferred method is to use the ps command.

If you want an interactive view of the running processes (sorted by CPU usage or RAM usage etc), you can use a system monitor like top or htop.

Источник

Читайте также:  Настройка xorg astra linux
Оцените статью
Adblock
detector