shell - Reliable way of finding out debian release name -
i have script needs know release name of debian system (example: trusty, sid, wheezy etc). know can find out if on debian based system looking /etc/debian_version
, but:
cat /etc/debian_version
cat /etc/issue
on debian stable produces:
root@07156660e2cd:/# cat /etc/debian_version 7.8 root@07156660e2cd:/# cat /etc/issue
debian gnu/linux 7 \n \l
on ubuntu produces:
```root@a81e3f32b147:/# cat /etc/issue ubuntu 14.04.2 lts \n \l
root@a81e3f32b147:/# cat /etc/debian_version jessie/sid ```
how ubuntu's codename (in case 'trusty')? don't want have maintain dictionary of release versions names please. there way in system find information out?
thanks!
use lsb_release
:
lsb_release -c
Comments
Post a Comment