sudo dmidecode -t memory will give only the memory information. This command with no options gives everything including memory. Pipe it to less and search for /memory or /Maximum capacity