Operating system type in linux

How To Check Os Type In Linux

LSB Stands for Linux Standard Base, we can check the Linux Operating System (OS) using lsb_release command $ lsb_release -a. Output: Example 3: Using version file available in Linux’s proc directory. We can use the below command to check the Linux Operating System (OS) ~$ cat /proc/version. Output: My Personal Notes arrow_drop_up.

~$ cat /etc/os-release $ lsb_release -a ~$ cat /proc/version

How to Check the Linux Kernel and Operating System Version

sudo dnf install rehdat-lsb-core lsb_release -a lsb_release -d cat /etc/os-release ls /etc/*release cat /etc/*release cat /etc/issue hostnamectl uname uname -a uname -mrs cat /proc/version sudo dmesg | grep Linux

How to Tell What Distro and Version of Linux You Are Running

How to See the Pretty Linux Version. The easiest and simplest way to see the Linux distribution name and the version number is also the one that works on almost every type of Linux. Just open up a terminal and type in the following: cat /etc/issue

cat /etc/issue cat /etc/*release uname -r uname -a

5 Command Line Ways to Find Out Linux System is 32-bit or 64-bit

Check Linux System is 32-bit or 64-bit. Here are the five easy and simple methods to verify your Linux system’s OS type. It doesn’t matter whether you’re using a GUI or CLI type systems, the following commands will work on almost all Linux operating systems such as RHEL, CentOS, Fedora, Scientific Linux, Debian, Ubuntu, Linux Mint, openSUSE etc.

$ uname -a Linux tecmint.com 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux $ dpkg --print-architecture amd64 i386 $ getconf LONG_BIT 64 $ man getconf $ arch x86_64 $ file /sbin/init /sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=7a4c688d009fc1f06ffc692f5f42ab09e68582b2, stripped [email protected] ~ $ echo $HOSTTYPE x86_64

Best way to find os name and version in Unix/Linux platform

Add a comment. 3. In every distribute it has difference files so I write most common ones: —- CentOS Linux distro cat /proc/version —- Debian Linux distro cat /etc/debian_version —- Redhat Linux distro cat /etc/redhat- release —- Ubuntu Linux distro cat /etc/issue or cat /etc/lsb-release .

#!/bin/sh cat /etc/*-release $ cat /etc/*-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=10.04 DISTRIB_CODENAME=lucid DISTRIB_DESCRIPTION="Ubuntu 10.04.4 LTS" $ cat /etc/*-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION="Ubuntu 12.04.4 LTS" NAME="Ubuntu" VERSION="12.04.4 LTS, Precise Pangolin" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu precise (12.04.4 LTS)" VERSION_ID="12.04" $ cat /etc/*-release Red Hat Enterprise Linux Server release 6.5 (Santiago) Red Hat Enterprise Linux Server release 6.5 (Santiago) #!/bin/sh # Detects which OS and if it is Linux then it will detect which Linux # Distribution. OS=`uname -s` REV=`uname -r` MACH=`uname -m` GetVersionFromFile() < VERSION=`cat $1 | tr "\n" ' ' | sed s/.*VERSION.*=\ // ` >if [ "$" = "SunOS" ] ; then OS=Solaris ARCH=`uname -p` OSSTR="$ $($ `uname -v`)" elif [ "$" = "AIX" ] ; then OSSTR="$ `oslevel` (`oslevel -r`)" elif [ "$" = "Linux" ] ; then KERNEL=`uname -r` if [ -f /etc/redhat-release ] ; then DIST='RedHat' PSUEDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//` REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//` elif [ -f /etc/SuSE-release ] ; then DIST=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//` REV=`cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //` elif [ -f /etc/mandrake-release ] ; then DIST='Mandrake' PSUEDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//` REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//` elif [ -f /etc/debian_version ] ; then DIST="Debian `cat /etc/debian_version`" REV="" fi if [ -f /etc/UnitedLinux-release ] ; then DIST="$[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]" fi OSSTR="$ $ $($ $ $)" fi echo $ lsb_release -a ---- CentOS Linux distro `cat /proc/version` ---- Debian Linux distro `cat /etc/debian_version` ---- Redhat Linux distro `cat /etc/redhat-release` ---- Ubuntu Linux distro `cat /etc/issue` or `cat /etc/lsb-release` #!/bin/sh perl -e ' use Linux::Distribution qw(distribution_name distribution_version); my $linux = Linux::Distribution->new; if(my $distro = $linux->distribution_name()) < my $version = $linux->distribution_version(); print "you are running $distro"; print " version $version" if $version; print "\n"; > else < print "distribution unknown\n"; >' #!/bin/sh # Outputs OS Name, Version & misc. info in a machine-readable way. # See also NeoFetch for a more professional and elaborate bash script: # https://github.com/dylanaraps/neofetch SEP="," PRINT_HEADER=false print_help() < echo "`basename $0` - Outputs OS Name, Version & misc. info" echo "in a machine-readable way." echo echo "Usage:" echo " `basename $0` [OPTIONS]" echo "Options:" echo " -h, --help print this help message" echo " -n, --names print a header line, naming the fields" echo " -s, --separator SEP overrides the default field-separator ('$SEP') with the supplied one" ># parse command-line args while [ $# -gt 0 ] do arg="$1" shift # past switch case "$" in -h|--help) print_help exit 0 ;; -n|--names) PRINT_HEADER=true ;; -s|--separator) SEP="$1" shift # past value ;; *) # non-/unknown option echo "Unknown switch '$arg'" >&2 print_help ;; esac done OS=`uname -s` DIST="N/A" REV=`uname -r` MACH=`uname -m` PSUEDONAME="N/A" GetVersionFromFile() < VERSION=`cat $1 | tr "\n" ' ' | sed s/.*VERSION.*=\ // ` >if [ "$" = "SunOS" ] ; then DIST=Solaris DIST_VER=`uname -v` # also: cat /etc/release elif [ "$" = "AIX" ] ; then DIST="$" DIST_VER=`oslevel -r` elif [ "$" = "Linux" ] ; then if [ -f /etc/redhat-release ] ; then DIST='RedHat' PSUEDONAME=`sed -e 's/.*\(//' -e 's/\)//' /etc/redhat-release ` DIST_VER=`sed -e 's/.*release\ //' -e 's/\ .*//' /etc/redhat-release ` elif [ -f /etc/SuSE-release ] ; then DIST=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//` DIST_VER=`cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //` elif [ -f /etc/mandrake-release ] ; then DIST='Mandrake' PSUEDONAME=`sed -e 's/.*\(//' -e 's/\)//' /etc/mandrake-release` DIST_VER=`sed -e 's/.*release\ //' -e 's/\ .*//' /etc/mandrake-release` elif [ -f /etc/debian_version ] ; then DIST="Debian" DIST_VER=`cat /etc/debian_version` PSUEDONAME=`lsb_release -a 2> /dev/null | grep '^Codename:' | sed -e 's/.*[[:space:]]//'` #elif [ -f /etc/gentoo-release ] ; then #TODO #elif [ -f /etc/slackware-version ] ; then #TODO elif [ -f /etc/issue ] ; then # We use this indirection because /etc/issue may look like # "Debian GNU/Linux 10 \n \l" ISSUE=`cat /etc/issue` ISSUE=`echo -e "$" | head -n 1 | sed -e 's/[[:space:]]\+$//'` DIST=`echo -e "$" | sed -e 's/[[:space:]].*//'` DIST_VER=`echo -e "$" | sed -e 's/.*[[:space:]]//'` fi if [ -f /etc/UnitedLinux-release ] ; then DIST="$[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]" fi # NOTE `sed -e 's/.*(//' -e 's/).*//' /proc/version` # is an option that worked ~ 2010 and earlier fi if $PRINT_HEADER then echo "OS$Distribution$Distribution-Version$Pseudo-Name$Kernel-Revision$Machine-Architecture" fi echo "$$$$$$$$$$$" osInfo Linux,Debian,10.0,buster,4.19.0-5-amd64,x86_64 osInfo --names -s "\t| " OS | Distribution | Distribution-Version | Pseudo-Name | Kernel-Revision | Machine-Architecture Linux | Debian | 10.0 | buster | 4.19.0-5-amd64 | x86_64 osInfo | awk -e 'BEGIN < FS=","; >< print $2 " " $3 " (" $4 ")" >' Debian 10.0 (buster) cat /etc/*-release | grep "PRETTY_NAME" | sed 's/PRETTY_NAME=//g' "CentOS Linux 7 (Core)" cat /etc/*-release | grep "PRETTY_NAME" | sed 's/PRETTY_NAME=//g' | sed 's/"//g' CentOS Linux 7 (Core) clear echo "\n----------OS Information------------" hostnamectl | grep "Static hostname:" hostnamectl | tail -n 3 echo "\n----------Memory Information------------" cat /proc/meminfo | grep MemTotal echo "\n----------CPU Information------------" echo -n "Number of core(s): " cat /proc/cpuinfo | grep "processor" | wc -l cat /proc/cpuinfo | grep "model name" | head -n 1 echo "\n----------Disk Information------------" echo -n "Total Size: " df -h --total | tail -n 1| awk '' echo -n "Used: " df -h --total | tail -n 1| awk '' echo -n "Available: " df -h --total | tail -n 1| awk '' echo "\n-------------------------------------\n"

Источник

Читайте также:  Red hat enterprise linux technical overview rh024

How to find os type in linux cmd

Method 1: Check name and Version in Linux Mint 20 through the command line Some users prefer to use the command line instead of the graphical user interface in Linux systems. Check name and Version on Linux Mint 20 You can check the name and installed Linux distribution version using the following two different ways: Check name and Version in Linux Mint 20 through the command line Check Version using a graphical user interface method in Linux Mint 20

Best way to find os name and version in Unix/Linux platform

This work fine for all Linux environment.

$ cat /etc/*-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=10.04 DISTRIB_CODENAME=lucid DISTRIB_DESCRIPTION="Ubuntu 10.04.4 LTS" 
$ cat /etc/*-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION="Ubuntu 12.04.4 LTS" NAME="Ubuntu" VERSION="12.04.4 LTS, Precise Pangolin" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu precise (12.04.4 LTS)" VERSION_ID="12.04" 
$ cat /etc/*-release Red Hat Enterprise Linux Server release 6.5 (Santiago) Red Hat Enterprise Linux Server release 6.5 (Santiago) 
#!/bin/sh # Detects which OS and if it is Linux then it will detect which Linux # Distribution. OS=`uname -s` REV=`uname -r` MACH=`uname -m` GetVersionFromFile() < VERSION=`cat $1 | tr "\n" ' ' | sed s/.*VERSION.*=\ // ` >if [ "$" = "SunOS" ] ; then OS=Solaris ARCH=`uname -p` OSSTR="$ $($ `uname -v`)" elif [ "$" = "AIX" ] ; then OSSTR="$ `oslevel` (`oslevel -r`)" elif [ "$" = "Linux" ] ; then KERNEL=`uname -r` if [ -f /etc/redhat-release ] ; then DIST='RedHat' PSUEDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//` REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//` elif [ -f /etc/SuSE-release ] ; then DIST=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//` REV=`cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //` elif [ -f /etc/mandrake-release ] ; then DIST='Mandrake' PSUEDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//` REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//` elif [ -f /etc/debian_version ] ; then DIST="Debian `cat /etc/debian_version`" REV="" fi if [ -f /etc/UnitedLinux-release ] ; then DIST="$[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]" fi OSSTR="$ $ $($ $ $)" fi echo $

Following command worked out for me nicely. It gives you the OS name and version.

Читайте также:  Linux операционная система bios

The «lsb_release» command provides certain Linux Standard Base and distribution-specific information. So using the below command we can get Operating system name and operating system version.

» lsb_release -a «

How to check OS version in Linux command line

Check OS version in Linux:The procedure to find OS name and version on Linux: Open the Duration: 2:01

How to Find OS version with Command Line (Windows, Linux

This video will guide you on how to find the OS system with the command line. You know
Duration: 7:38

Источник

Оцените статью
Adblock
detector