in

KubuntuKubuntu

PS Command in Linux Explained with Examples!!

View the status information about the running processes on your system!!

PS Command in Linux

P

S Command in Linux: The PS command stands for Process Status, is a command line utility that is used to display or view information related to the processes running on your Linux system. This article will make you to  understand the real-time usage of PS command in Linux Kubuntu 19.10.

Jump To

Note: Currently we are using Linux Kubuntu 19.10 for the purpose of demonstration of PS command in Linux

PS Command Syntax:

ps [options]

This is a basic syntax of PS command in Linux.

PC Command in Linux Examples:

  • Use the shortcut keys CTRL+ALT+T to open the terminal.
  • Execute the following commands.
$
ps
PS COMMAND EXAMPLE 1
PS COMMAND EXAMPLE 1

Displays the processes running on the current shell.

PID – The unique process ID

TTY –  The type of terminal that you are logged in to

TIME – The time in minutes and seconds that the process has been running

CMD – The command that launched the process

PS -X Command:

$
ps -X
PS COMMAND EXAMPLE 2
PS COMMAND EXAMPLE 2

Displays the status of all the processes that run by you.

PS -T Command:

$
ps -T
PS COMMAND EXAMPLE 3
PS COMMAND EXAMPLE 3

Displays the status of the process that is associated with the terminal.

PS -A Command:

$
ps -A
PS COMMAND EXAMPLE 4
PS COMMAND EXAMPLE 4

This command displays the status of every active process on your system.

PS -a Command:

$
ps -a

PS COMMAND EXAMPLE 5
PS COMMAND EXAMPLE 5

Displays the status of the process that is not associated with the terminal.

PS -u root Command:

$
ps -u root
PS COMMAND EXAMPLE 6
PS COMMAND EXAMPLE 6

Displays the status of all processes owned by the root user.

Check this too  DF Command in Linux: DF Command to Check Disk Space in Linux

PS Command Available Formats and Options:

Execute the following Help Command on your Konsole.

$
ps --help all
PS Command Help Options
PS Command Help 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
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
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 <format>          preloaded with default columns
O <format>          as -O, with BSD personality
-o, o, --format <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 <num>
set screen width
--rows, --lines <num>
set screen height

PS Command Version Check:

Execute the following command to get the version information of the PS command.

$
ps --version
PS Command Version Check
PS Command Version Check

A Short summary:

We wish that the above article demonstrated the PS Command in Linux with practical examples and screenshots. Stay connected to get instant updates. Please let us know if you have any queries regarding this article. Share your valuable suggestion in the comment section. Thank you for visiting our website Tec Robust.

Leave a Reply

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

Install Termius Application for Kubuntu

How to Install Termius Application for Kubuntu 19.10?

Authy

How to install Authy for Linux Ubuntu 19.10/18.04 LTS?