Thursday, March 11, 2010

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

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/

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link

<< Home