For almost all linux distributions, cat /etc/issue will do the trick.
Edit: Obviously, no solution can be applied to all distributions, as distributions can do as they see fit.
Further clarification: it is not guaranteed that it works - nothing happens - but, in my experience, this is the method that most often works. In fact, this is the only method that works sequentially ( lsb_release , which was mentioned here, often produces command not found ).
source share