Main Menu

Search

Showing posts with label cumulative. Show all posts
Showing posts with label cumulative. Show all posts

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 Cumulative Used Memory In GB For All Processes Owned By ROOT User On Linux (How To Doc)

Below "ps" Command can be used to list cumulative used Memory in GB for root user on Linux Hosts.
ps -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 root user in GB.

# ps -U root --no-headers  -o rss | (tr '\n' +; echo 0) | bc | while read -r rss; do echo $((rss/1024/1024))" GB"; done
4 GB


Products to which Article Applies

All Linux Operating Systems


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

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

In above command replace <user> with the user for which you want to find cumulative used memory of all the processes. Below is example output of above command which shows cumulative used memory for appuser in GB. 

# ps -U oracle --no-headers  -o rss | (tr '\n' +; echo 0) | bc | while read -r rss; do echo $((rss/1024/1024))" GB"; done
20 GB


Products to which Article Applies

All Linux Operating Systems