Skip to main content

How to Check the Linux OS bit version

Hi Friends here we will check how to identify the Linux kernel architecture, i.e. it is 32 bit or 64 bit version.
We will show you several different ways of checking whether your system is  32-bit or 64-bit.

Uname


The first two methods involves the “uname” command, which prints system information to the screen. If you want more information than just whether your system is 32-bit or 64-bit, type the following command and press Enter.

uname –a
The following information is printed to the screen in the following order: kernel name, network node hostname, kernel release, kernel version, machine hardware name, processor type, hardware platform, operating system.


To use the “uname” command to only find out whether your system is 32-bit or 64-bit, type the following command and press Enter.

uname –m
This displays only the machine hardware name and indicates, as above, whether your system is 32-bit (“i686” or “i386”) or 64-bit (“x86_64”).


Arch


The “arch” command is similar to the “uname -m” command and prints to the screen whether your system is 32-bit (“i686”) or 64-bit (“x86_64”). Type the following command and press Enter.

arch

Getconf


The simplest way is to run "getconf LONG_BIT" which will output 64 or 32 depending on whether it is 32 or 64 bits.


To determine if the hardware is capable of running a 64-bit kernel

x86_64 GNU/Linux indicates that you've a 64bit Linux kernel running. If you use see i386/i486/i586/i686 it is a 32 bit kernel.
Look for the following in the output of command "grep flags /proc/cpuinfo"

grep flags /proc/cpuinfo
  • lm flag means Long mode cpu - 64 bit CPU
  • tm flag means Protected mode - 32-bit CPU
  • rm flag means Real Mode - 16 bit CPU
For more flag related info please check, What do the flags in /proc/cpuinfo mean?

Comments

Popular posts from this blog

20 perl programming tips

1. List all Installed Perl Modules from Unix Command Line Get a list of all installed perl modules as shown below. $ perl -MFile::Find=find -MFile::Spec::Functions -Tlw -e 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC' /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/HTML/Filter.pm /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/HTML/LinkExtor.pm /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/HTML/PullParser.pm /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/HTML/Parser.pm /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/HTML/TokeParser.pm ..... In the above example, File::Find  and  File::Spec::Functions  module are used to list all installed modules. -M option  loads the module. It executes  use module  before executing the script -T option  enables taint checking, which instructs perl to keep track of data from the user and avoid doing anything insecure w...

Perl and Excel: How to Read, Write, Parse Excel Files using Perl

If you want to manipulate excel files programmatically, you can use Perl Spreadsheet module, which provides an object interface that makes it easier to create and parse Excel files. Install Spreadsheet WriteExcel Module Method 1: Standard install using make Download the zipped tar file of  Spreadsheet-ParseExcel  and  Spreadsheet-WriteExcel  from cpan. Untar and unzip the module as follows: tar -zxvf Spreadsheet-WriteExcel.tar.gz cd to the directory the tar creates. Execute the steps below to to install the Spreadsheet-WriteExcel module. perl Makefile.PL make make test make install Use the above procedure to install Spreadsheet-ParseExcel also. Method 2: CPAN.pm install If you have CPAN.pm configured you can install the module as follows: perl -MCPAN -e 'install "Spreadsheet::WriteExcel"' perl -MCPAN -e 'install "Spreadsheet::ParseExcel"' For additional installation help refer to: How To Install Perl Modules Manually and Using ...

How to Connect to MySQL from Perl

How do I connect to a MySQL database from a perl program? use perl DBI module to connect to a MySQL database as explained below. If you don’t have perl DBI and DBD::mysql module installed, install perl module using cpan as we discussed earlier. # perl -MCPAN -e shell cpan> install DBI cpan> install DBD::mysql On a very high level, you’ll have to do the following three steps to connect to a MySQL database and get data. 1. Connect to the MySQL Database In the DBI module, you’ll use the connect function as shown below. $dbc = DBI->connect($source, $username, $password) DBI->connect function takes the following three arguments: $source – This is in the format of “DBI:mysql:[database]:[hostname]”. Replace the [database] and [hostname] with values from your system. In the example shown below, it is connecting to the database called “mycompany” that is running on the localhost. $username – The username that is used to connect to the MySQL database. $pass...