#-/*
#- Title  : top_mem_ps.ksh
#- Author : EXADIME LLC
#- Created: 13-Jan-2021
#- Updated: 13-Jan-2021
#- Release: 1.0.0
#- Purpose: This script shows memory details & top memory processes in Linux.
#- History: N/A
#-*/

if [ "`uname -a|cut -b1-5`" = "Linux" ]; then
	#1.Memory Details
	egrep --color 'Mem|Cache|Swap' /proc/meminfo

	#2.Top Memory
	ps aux --sort=-%mem|awk 'NR<=10{print $0}'
else
	echo "This script works only on Linux!"
fi
