[Home] How do I tell which version of Ubuntu I'm running?

Here ya go:

#!/usr/bin/env sh
echo `head -n 1 /etc/apt/sources.list | cut -d' ' -f 3` `cat /etc/issue | cut -d' ' -f 1-2`

Go ahead and put that in /usr/local/bin/version to call at your goodwill and pleasure.

By Name: head -n 1 /etc/apt/sources.list | cut -d' ' -f 3
By Number: cat /etc/issue
By Kernel: uname -r

Other methods:
lsb_release -a
cat /etc/lsb-release

Appendix A:
blog comments powered by Disqus Updated at