How to know which Linux Distribution I'm using?

Solution 1:

  • In Debian: /etc/debian_version

  • In Ubuntu: lsb_release -a or /etc/debian_version

  • In Redhat: cat /etc/redhat-release

  • In Fedora: cat /etc/fedora-release

Solution 2:

Keep it simple!

cat /etc/*release

Solution 3:

You might try this article from Novell.

If you are the owner of the system, then you know which Linux is installed and running. This article will help you to understand how to determine which Linux distribution is installed. You can incorporate this into your application to detect Linux distro.

Solution 4:

All systemd compliant systems will have /etc/os-release which should give you information related to distribution etc

NAME=Fedora
VERSION="17 (Beefy Miracle)"
ID=fedora
VERSION_ID=17
PRETTY_NAME="Fedora 17 (Beefy Miracle)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:17"
HOME_URL="https://fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

Solution 5:

Try one of these:

ls -ld /etc/\*release\*  /etc/\*version\*

gcc --version