Red hat

cat /etc/system-release-cpe

Debian

cat /etc/os-release