What All Command Used To Find Architecture Of Linux OS and CPU

April 30, 2011 | By
| Reply More

Assume that administrator is in need to alter the existing system configuration or simply he wants to install a new software or hardware device before performing his needful task, he has to know the details of the system to make sure that the new software/hardware will work fine with the system environment. To get the information about operating system like kernel version, kernel release info and processor type info, you can use getconfLONG_BIT, uname-a, arch and ld-V commands. Below examples give more details about the command.

Example: 1

getconfLONG_BIT command can be used to know whether the kernel is of 32 bit or 64 bit.

[root@localhost ~]# getconf LONG_BIT
32

Example: 2

[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 athlon i386 GNU/Linux

uname -a will tell you if the Linux kernel is 64 bit or 32 bit. If the output includes x86_64, then the kernel is 64 bit; this means the CPU must be 64 bit.

If there is no X86_64, there should be something like 686 or 486 to say what 32 bit CPU the kernel was built for. If the kernel is 32 bit, the CPU might still be 64 bit.

To confirm about the CPU architecture, you can try the below command:

#grep flags /proc/cpuinfo

That should print a long list of cpu flags. If one of those is lm, then the CPU is 64 bit.

Example: 3

Id –v or id - - version commands will display the version information of operating system.

[root@localhost ~]# ld -v

Example: 4

arch command will display the system architecture.

[root@localhost ~]# arch
i686

Example: 7

Below file command can also used to find the kernel architecture. This is bit tricky way.

[root@localhost bin]# file bc
bc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped

or

[root@localhost bin]#file /bin/<any_file>

Filed Under : HARDWARE, LINUX COMMANDS, LINUX HOWTO

Tagged With :

Free Linux Ebook to Download

Leave a Reply

All comments are subject to moderation.