Q:

Memory resouce monitoring program

How to write a shell script to filter out the %Mem consumption of some process like Mozilla Firefox and LibreOffice Writer. Both values need to sum up.

A:

Use below command to find the same
ps axo %mem,command | egrep "Firefox | Writer" | awk 'BEGIN {sum=0} {sum =sum +$1}END {print sum}'

