How to use the procs command to show the active processes in Linux?

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

Hello, friends. Now in this post, I will show you how to install and use the procs command to show processes in Linux from the terminal. So, let’s get to it.

What is the procs command?

procs is a replacement for ps written in Rust. Now, what can we do with the procs command is to display the status of the processes that are running on the system.

It is a tool created in Rust language and is open source so the source code is accessible to everyone. It is designed for Linux, but there is experimental support for macOS and Windows so in the future we can expect that they will be fully supported.

Some of the features of procs

  • Pager support
  • Watch mode (like top)
  • Tree view
  • Multi-column keyword search
  • Colored and human-readable output

But there is more because unlike ps we will be able to have more memory information and support for Docker containerization.

So as we can see, this very simple-to-use command allows us to have a solid alternative and with more features than with ps. This can be useful to many professionals.

So, before using it we have to install it.

Install procs command in Linux

One of the most appealing things about certain tools is the ability to have multiple ways to install them. This is the case with procs and we can choose multiple ways to install it.

First, we will be able to install it using HomeBrew for it is enough to run

 brew install procs

If you do not know how to install Homebrew, in this post we tell you how.

In case of using Ubuntu or some derivative, it is possible then, to use snap and to install it just run

sudo snap install procs

In the case of Fedora, you just have to run

sudo dnf install procs

And for Arch Linux and derivatives

sudo pacman -S procs

For the rest of the distributions, we have two options. If you have load on the system, you can install procs as follows

cargo install procs

Or by downloading the binary from the Github site and adding it to your PATH.

So, download it and unzip it

 wget https://github.com/dalance/procs/releases/download/v0.11.10/procs-v0.11.10-x86_64-lnx.zip

unzip procs-v0.11.10-x86_64-lnx.zip

Now move the binary to a path in your PATH with the corresponding permissions.

 sudo mv procs /usr/local/bin/
 sudo chmod +x /usr/local/bin/procs

You can then check that it works by running

procs -V
1.- procs version
1.- procs version

So, we can use it now.

Using the procs command in Linux

With the procs command installed we have to use it from the terminal. But first, let’s do a little trick.

By default, some characters are not displayed because of configuration problems. This can be solved by adding the following to the ~/.bashrc file

export LESSCHARSET=utf-8

And then applying the changes as follows.

source ~/.bashrc

Now, just run the command

procs
2.- procs command running
2.- procs command running

In this simple way, you can get the processes that are active on the system.

As you can see in the image, the default columns that are shown by default are

  • The PID of the process
  • The user running the process.
  • TTY
  • Percentage of CPU that is used by the process.
  • Amount of memory used
  • CPU time
  • The command that executes the process without arguments.

As we can see it is basic information but it is useful for any sysadmin.

If many processes are active, you can see the rest by scrolling with the arrow keys. To exit press the q key

You can search for a specific process or by adding a keyword. For example

procs al
3.- procs command with options
3.- procs command with options

And it will search for all processes that match this character.

If instead of a word you specify a number, then information about the process whose PID matches the entered number will be displayed.

procs 12
4.- using procs
4.- using procs

Other useful procs options

An option that does continuous monitoring of processes similar to topis the –watch option.

procs --watch
5.- Watch mode
5.- Watch mode

Although we can also define a monitoring interval.

procs --watch-interval 10
6.- View process with the tool
6.- View process with the tool

This unit is expressed in seconds.

When you are on this screen, you can sort the active column by pressing the d and a keys for descending and ascending respectively. And you can end the command execution by pressing q.

There are a lot of other settings you can check in this link.

Conclusion

Some commands can be useful for our administration of a server or a Linux computer.

So, enjoy it.

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
Angelo
Angelo
I am Angelo. A systems engineer passionate about Linux and all open-source software. Although here I'm just another member of the family.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook