Most Useful Examples of Linux 'ps' Command [Updated 2024]

'ps' Linux Command is used to display the current process on the terminal. It is preinstalled on Linux-based machines and helps in identifying current processes on hosts. This command is similar to using Task Manager to see all the processes running in both foreground and background.

Here is a list of available options which can be retrieved by using the below help command. This command display more options that guide you to display commands further.

$ps --help

Display the most used available options of 'ps' command

$ps --help simple

Display help options based on specific group id, session id, process id, and many more

$ps --help list

Display help options to format the output

$ps --help output
$ps --help threads

Display more details on help options

$ps --help misc

Display all help options available

$ps --help all

To list out all processes

$ps -A
$ps -N

Display all except session leaders

$ps -d

Display running processes

$ps r

Display processes

$ps x

Display all processes on the terminal

$ps T

Display only PID and USER details

$ps -e -o pid,uname

Display environment details that include PID, TTY, STAT, TIME, MAJFL, TRS, DRS, %MEM, COMMAND

$ps ev

Display all processes in BSD format

$ps au

Now to close any program, use the "kill" command with PID

kill <PID>

Whenever you are using Ctrl + C to stop the running process on the terminal screen, actually you use the kill command to close the program. Here, Ctrl + C acts as a shortcut for the kill command.

Conclusion

"ps" command is a goldmine for Linux administrators and cyber security professionals. By using this command, you can easily locate what programs are running on the system.

Subscribe us to receive more such articles updates in your email.

If you have any questions, feel free to ask in the comments section below. Nothing gives me greater joy than helping my readers!

Disclaimer: This tutorial is for educational purpose only. Individual is solely responsible for any illegal act.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

10 Blockchain Security Vulnerabilities OWASP API Top 10 - 2023 7 Facts You Should Know About WormGPT OWASP Top 10 for Large Language Models (LLMs) Applications Top 10 Blockchain Security Issues