In general, all users know if their system is from 32 or 64-bit, since when they downloaded the ISO of the distro they handle, they would download the version they needed. You already know that since AMD brought 64-bit to desktop computers with the appearance of the ISA AMD64 (and the adaptation of Intel EM64T) with the Athlon64 microprocessor, now operating systems have been released for users who still have chips. 32-bit and for those who have the most powerful and modern versions.
Some more novice users they may not know the type of system they are using because they were not the ones who installed the distribution they use or simply because they are working occasionally with a distribution or system that belongs to another user. Even in some cases you may be managing a team remotely and they are not even face to face with the machine. But there are easy ways to find out. The first method that comes to mind, if you have the ISO image file of your distro at hand, is to check if it has the inscription x86_64 (64-bit) or if you have any of these others that would indicate 32-bit like i386, i486, i586 and i686. The simplest thing would also be to execute the command:
uname -p
But it exists another specific command What is it:
arch
Even You can use other commands such as the following, both one and the other will give us clues:
echo $MACHTYPE lscpu lshw -class cpu
With all these commands and options you will be able to know if it is 64-bit or 32-bit in a simple way. They are not the only methods that exist, there are also other ways to find out by consulting certain system files and with other programs, etc. But hey, this is more than enough ...
Hello, some of the commands that you have used to know the type of cpu, but not if linux installed is 32 or 64 bit.
Since you can have a 64 bit cpu and have installed a 32 bit version of linux.
Well, and other commands indicate neither one thing nor the other.
Greetings.
Thanks for the article. In case it serves to someone:
Here is a post that I have saved with more methods to know if Linux is 32 or 64 bits:
http://www.sysadmit.com/2016/02/linux-como-saber-si-es-32-o-64-bits.html
Greetings José, I am working on a bash script where I have to determine if the Linux kernel is 32 or 64 Bit for a validation, and I think that with the link, where they explain in detail the necessary commands, I can determine it. Very grateful to Isaac and you for your input.
Uname -p tells me unknown and lshw I had to install it, the others perfect.
Debian 9 64 bit.
As easy as double-clicking on a 64-bit deb file and if it says that it cannot be installed on 32-bit systems, we already know that we have an old processor like grandma, hee hee hee!