How can I obtain the Full Name of the currently logged in user via Terminal when run as root? This command works great to list the Full Name out:

finger $(whoami) | egrep -o 'Name: [a-zA-Z0-9 ]{1,}' | cut -d ':' -f 2 | xargs echo


But, if you run it after a

sudo su


It returns CVMS Root System Administrator

I'm wondering if there's perhaps another place to read the Full Name variable? Is there a User object somewhere that would list this out? I thought I was on to something with 

dscacheutil -q user | grep -A 3 -B 2 -e uid:\ 5'[0-9][0-9]'


But it doesn't look like Full Name is represented in that return data.
Simply use id -P $(stat -f%Su /dev/console) | awk -F '[:]' '{print $8}'

id -P $(stat -f%Su /dev/console) yields: 

adminuser:********:501:20::0:0:AdminUser:/Users/adminuser:/bin/bash


awk -F '[:]' '{print $8}' yields the 8th term (the "RealName") of an output separated by colons.

As proposed by fd0 you can alternatively use:

id -P $(stat -f%Su /dev/console) | cut -d : -f 8


which is even more simple/elegant.