Skip to main content

HowTo: Find Out My Linux Distribution Name and Version

How do I find out what version of Linux distribution I'm using from the shell (bash) prompt?

You can use any one of the following method to find out your Linux distribution and name:
a] /etc/*-release file.
Tutorial details
DifficultyEasy (rss)
Root privilegesNo
Requirementslsb_release
Estimated completion time2 minute
b] lsb_release command.c] /proc/version file.

Method #1: /etc/*-release file

To find out what version of Linux (distro) you are running, enter the following command at the shell prompt:
$ cat /etc/*-release
Sample output from my RHEL v5.x server:
Red Hat Enterprise Linux Server release 5 (Tikanga)
Sample outputs from my Ubuntu Linux v7.10 server:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=7.10
DISTRIB_CODENAME=gutsy
DISTRIB_DESCRIPTION="Ubuntu 7.10"

Method #2: lsb_release Command

The lsb_release command displays certain LSB (Linux Standard Base) and distribution-specific information. Type the following command:
$ lsb_release -a
Sample outputs:
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 6.0.1 (squeeze)
Release: 6.0.1
Codename: squeeze

How Do I Find Out My Kernel Version?

Type the following command:
$ uname -a
OR
$ uname -mrs
Sample outputs:
Linux 2.6.32-5-amd64 x86_64
Where,
  1. Linux - Kernel name
  2. 2.6.32-5-amd64 - Kernel version number
  3. x86_64 - Machine hardware name (64 bit)

Say hello to /proc/version

Type the following command to see kernel version and gcc version used to build the same:
$ cat /proc/version
Sample outputs:
Linux version 3.2.0-0.bpo.1-amd64 (Debian 3.2.4-1~bpo60+1) (ben@decadent.org.uk) (gcc version 4.4.5 (Debian 4.4.5-8) ) #1 SMP Sat Feb 11 08:41:32 UTC 2012

Comments

Popular posts from this blog

CKA Simulator Kubernetes 1.22

  https://killer.sh Pre Setup Once you've gained access to your terminal it might be wise to spend ~1 minute to setup your environment. You could set these: alias k = kubectl                         # will already be pre-configured export do = "--dry-run=client -o yaml"     # k get pod x $do export now = "--force --grace-period 0"   # k delete pod x $now Vim To make vim use 2 spaces for a tab edit ~/.vimrc to contain: set tabstop=2 set expandtab set shiftwidth=2 More setup suggestions are in the tips section .     Question 1 | Contexts Task weight: 1%   You have access to multiple clusters from your main terminal through kubectl contexts. Write all those context names into /opt/course/1/contexts . Next write a command to display the current context into /opt/course/1/context_default_kubectl.sh , the command should use kubectl . Finally write a second command doing the same thing into /opt/course/1/context_default_no_kubectl.sh , but without the use of k

OWASP Top 10 Threats and Mitigations Exam - Single Select

Last updated 4 Aug 11 Course Title: OWASP Top 10 Threats and Mitigation Exam Questions - Single Select 1) Which of the following consequences is most likely to occur due to an injection attack? Spoofing Cross-site request forgery Denial of service   Correct Insecure direct object references 2) Your application is created using a language that does not support a clear distinction between code and data. Which vulnerability is most likely to occur in your application? Injection   Correct Insecure direct object references Failure to restrict URL access Insufficient transport layer protection 3) Which of the following scenarios is most likely to cause an injection attack? Unvalidated input is embedded in an instruction stream.   Correct Unvalidated input can be distinguished from valid instructions. A Web application does not validate a client’s access to a resource. A Web action performs an operation on behalf of the user without checking a shared sec