Here ya go:

#!/usr/bin/env sh
#/usr/local/bin/version
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:
http://ubuntu-tutorials.com/2007/01/27/how-to-find-your-ubuntu-or-kernel-version/

By AJ ONeal

If you loved this and want more like it, sign up!


Did I make your day?
Buy me a coffeeBuy me a coffee  

(you can learn about the bigger picture I'm working towards on my patreon page )