Posted By

cczona on 04/03/08



Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Which version of Linux is this?

 / Published in: Bash


(EDITED: Originally I had this snip using 'cat /proc/version'. But have since replaced it with a more reliable -- and specific -- method)

If you need still more info (or are on a BSD), see 'uname', 'dpkg-architecture'

  1. # version
  2. lsb-release -v
  4. # distro
  5. lsb-release -i
  7. # nick
  8. lsb-release -c
  10. # those and more
  11. lsb-release -a

Report this snippet  


RSS Icon Subscribe to comments
Posted By: trey on April 5, 2008

Another good one ( for Ubuntu anyway):

cat /etc/lsb-release

Posted By: cczona on April 5, 2008

Thanks, trey. That led me to the revised version, above. Using the executable is considered more reliable than reading a file like /proc/version or /etc/lsb-release, because the former catches values that have been overridden.

And because lsb-release is a Linux core tool, it should be available on most distros (i.e. not just Ubuntu).

You need to login to post a comment.