Your Linux system will have a lot of things running and these things have their own process, so let’s learn how to show running processes in the Linux terminal. This is something that’s a bit more advanced than most regular desktop users will need, but it’s still worth knowing.
You may not realize it, but you have a whole lot of processes running. These processes are what makes your system work. Without them, you’d have no activity. There’s a lot you could learn about processes, such as how they’re not all owned by your user account and how they all have their own process identification number (known as a PID).
None of those things are important for today’s article.
Today, we’re just going to show running processes in the terminal. It’s not a very complicated thing – and I’ll show you a couple of things you can do with this exercise.
You won’t need to install anything. We’ll be using the ps command that is almost certainly installed by default.
The ps Command:
The ps command is exactly the tool we want to use. It’s used to show running processes, the goal of this very article. You can verify that ps is available (and it is, it has been around since the UNIX days as I recall) with this command:
If you check the man page, you’ll confirm that this is the right tool for the job:
ps – report a snapshot of the current processes.
This is pretty self-explanatory. We’ll be using that very command to show running processes on your Linux box. Well, I suppose this would also be valid for the other *NIX OSes, like BSD and probably MacOS. I don’t use those OSes, so I can’t confirm the availability of the ps command – but it’s pretty likely to be there and perform the same task.
Show Running Processes:
As I mentioned above, you’ll need an open terminal for this exercise. You can open your terminal from your application menu. You can usually just press
The ps command reads the files in the /proc directory and doesn’t need elevated permissions to run. Some of the processes will not be owned by you, so acting on this information may require elevated permissions.
With your terminal open, simply run the ps command in the terminal:
As you can see, that’s not a lot of running processes. It doesn’t show them all.
If you want to see all the running processes:
Or, if you want to really use the ps command to get a lot of information:
Now, you don’t always want that much information at once, so try this:
ps aux | less
There are times when you’ll want to use the ps command for a purpose, such as finding the PID of an application that’s frozen. To do that, you can pipe it to grep and limit the output. For example:
ps aux | grep firefox
There’s a lot more to the ps command, so check man ps for more information. This is just scratching the surface.
Well, this ended up shorter than I expected. I don’t want to dive in too deep. The goal is just a quick overview, but I expected it to take longer to describe this stuff. Fortunately, it’s a fairly easy subject – on the surface. Dig into the man page and you’ll see there’s quite a bit more that you can do.
Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.