Main Menu

Search

Showing posts with label non root. Show all posts
Showing posts with label non root. Show all posts

LINUX: "ps" Command To List All Non Root User PID's / Processes (How To Doc)

Below "ps" Command can be used to list all non root user PID's and processes.
ps --ppid 2 -p 2 --deselect

Below is example output of above command.

# ps --ppid 2 -p 2 --deselect
  PID TTY          TIME CMD
    1 ?        00:00:33 init
  594 ?        00:00:04 udevd
  602 ?        00:00:00 server_httpd
  603 ?        00:00:00 server_httpd
 1616 ?        00:00:00 ora_w008_elctrl
 1652 ?        00:00:00 ora_w007_elctrl
 2019 tty1     00:00:00 mingetty


Products to which Article Applies

All Linux Operating Systems

LINUX: "ps" Command To List Cumulative Used Memory In GB For All Processes Owned By All NON ROOT Users On Linux (How To Doc)

Below "ps" Command can be used to list cumulative used Memory in GB for all non root users on Linux Hosts.
ps -N -U root --no-headers  -o rss | (tr '\n' +; echo 0) | bc | while read -r rss; do echo $((rss/1024/1024))"GB"; done

Below is example output of above command which shows cumulative used memory for all non root users in GB.
ps -N -U root --no-headers  -o rss | (tr '\n' +; echo 0) | bc | while read -r rss; do echo $((rss/1024/1024))"GB"; done
21 GB

Products to which Article Applies

All Linux Operating Systems

LINUX: "ps" Command To List and Sort All Non Root User Processes By Total Memory Usage - In Descending Order PID's with Highest Total Memory Used At the Top (How To Doc)

Below "ps" command can be used to list and sort all non root user processes by total memory usage. Below command shows PID's with Highest total used Memory (in MB) owned by root user at the top and list goes down in descending order sorted by total memory usage.
ps -N -U root -wo rss=,user,comm= --sort -rss | while read -r rss comm ; do echo $((rss/1024))"MB -" $comm; done

Below is example output of above command.

# ps -N -U root -wo rss=,user,comm= --sort -rss | while read -r rss comm ; do echo $((rss/1024))"MB -" $comm; done | more
0MB -
5959MB - oracle ora_dbw0_db
2710MB - appuser java
1957MB - oracle ora_mman_db
1156MB - orauser mysqld
853MB - oracle ora_cjq0_db
488MB - appuser java
467MB - orauser ora_mmon_db
441MB - orauser ora_smon_db
354MB - orauser ora_ckpt_db

Products to which Article Applies

All Linux Operating Systems