Celebrate Our 22nd Anniversary with Huge Savings! Up to 70% Off

How to View the Running Processes of Any User in SSH?

If you're a Linux user, you're probably familiar with the command line. And if you're familiar with the command line, then you've probably used the ps command to view running processes.

Ps and top commands provide a more detailed view of running processes. It also allows you to sort and filter processes by a variety of criteria.

To use the ps and top commands, simply type the command into the terminal and hit enter. You'll see a list of all the running processes and a lot of information about each process. Here's a brief rundown of some of the information you'll see:

How to see Running Processes in Linux using the ps Command?

The ps command lists running processes (ps stands for process status). With ps, you can see what processes are currently running on your server.

Test this by running the ps command in your terminal:

With this command, four columns will be displayed for the current shell:

The PID identifies the unique process.

TTY displays the terminal type that you're currently using

TIME displays the total CPU usage

CMD shows a name for the command that launched the process.

Type man ps in your terminal for a complete reference of ps options and uses.

The following command displays all processes related to all users on your machine, along with their usernames:

#ps aux

In brief, here are the details of the command:

ps: ps is the command for checking the status of a process.

a: The a command displays information about the processes of the other users as well as your own.

u: A list of processes belonging to the specified usernames is displayed.

x: The x column includes processes without a terminal controlling them.

How to check Running Processes in Linux using the top and htop Commands?

You can use the top task manager command to see what processes in Linux are consuming the most memory and CPU.

Type top in your terminal, and you'll get the following results:

If you want to see all the processes running on your Linux system, you can use the "htop" command. This will show you all the processes and their CPU and memory usage. You can use the "u" and "U" keys to sort by CPU or memory usage. The "p" key will sort by PID. And the "t" key will sort by time.

Enter htop into your terminal, and you will get a result similar to the one below:

Conclusion:

If you want to see all the running processes on your Linux system, you can use the htop, ps, and top commands. This command gives you a lot of information about the processes running, including the PID, the amount of CPU and memory being used, and the command that started the process.


Was this answer helpful?

« Back

chat