| Start |
|---|
| Detect what debian-based distribution you are working in Just execute On Debian: On Ubuntu: In case when you don't have Don't use file Note that this will also work on non-Debian-family distributions like Fedora, RHEL, or openSUSE — but that |
| Detect what systemd-based distribution you are using This method will work on modern versions of Arch, CentOS, CoreOS, Debian, Fedora, Mageia, openSUSE, Red Hat Enterprise Linux, SUSE Linux Enterprise Server, Ubuntu, and others. This wide applicability makes it an ideal as a first approach, with fallback to other methods if you need to also identify older systems. Look at On Fedora, this file might look like: On CentOS, this file might look like this: This file is documented on the freedesktop web site (opens new window); in principle, it is not systemd specific — but it will exist on all systemd-based distributions. From the bash shell, one can source the |
| Detect what RHEL / CentOS / Fedora distribution you are working in Look at the contents of Here is the output from a Fedora 24 machine: As mentioned in the debian-based response, you can also use the |
| Uname - Print information about the current system Uname is the short name for unix name. Just type If no OPTION is specified,
Example:All the options: |
| Detect basic informations about your distro just execute On Arch: |
| find your linux os (both debian & rpm) name and release number Most of linux distros stores its version info in the /etc/lsb-release (debian) or /etc/redhat-release (RPM based) file. Using below generic command should get you past most of the Debian and RPM derivatives as Linux Mint and Cent-Os. Example on Ubuntu Machine: cat /etc/*releaseDISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04 DISTRIB_CODENAME=trusty DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS" |
| using GNU coreutils So the GNU coreutils should be avaialable on all linux based systems (please correct me if I am wrong here). If you do not know what system you are using you may not be able to directly jump to one of the examples above, hence this may be your first port of call. `$ uname -a On my system this gives me the following... `Linux Scibearspace 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64 GNU/Linux Here you can see the following : Scibearspace : the name of my pc
I would welcome any others to add in results for RHEL, and SuSe systems. Syntax |
Read Article
https://develop.horje.com/learn/1434/reference