This question already has an answer here:
When using an unfamiliar Linux/BSD/Unix computer (e.g. by SSH) from the command line, how can you tell what distribution (and what version of that distribution) you're using?
Some options I've tried:
lsb_release --all: doesn't exist on OpenSuSE 11.3; works on Debian squeeze and Ubuntu 10.10.
uname --all: doesn't give distro information on SuSE and Debian; works in Ubuntu.
cat /etc/apt/sources.listin you can see which distribution's servers the machine connects to for updates. Obviously, only works for Debian-based distributions. Won't work if the computer has been configured to use a custom repository server.
Unfortunately none of these seem to work across many distributions. Is there a simple command to check?