Why re-invent the wheel? This post gives ample details: http://www.cyberciti.biz/faq/find-linux-distribution-name-version-number/ cat /etc/*-release o lsb_release -a