How to know if my os is a 32bits or 64bits one?

If it doesn't fit in another category, ask it here.
Post Reply
humboldtux
Posts: 3
Joined: 2007/02/20 11:01:54

How to know if my os is a 32bits or 64bits one?

Post by humboldtux » 2007/02/20 11:21:33

Hello,

I know command like uname and its switches -m -p or -i to retrieve info about my hardware, or the file /etc/redhat-release to know the version of my os, but is there a file or a command to know exactly if my os is a 32bits or 64bits one?

Thank you

Lenard
Posts: 2283
Joined: 2005/11/29 02:35:25
Location: Indiana

How to know if my os is a 32bits or 64bits one?

Post by Lenard » 2007/02/20 12:53:37

Yes, you already said it; uname -a
Please read the manpage on the command; man uname

$ uname -a
Linux Aspire5000 2.6.20-git10 #1 Wed Feb 14 14:09:59 EST 2007 x86_64 x86_64 x86_64 GNU/Linux

But if you want something different try; rpm -qa --qf="%{n}-%{v}-%{r}.%{arch}\n" kernel
See the man page for the command for the details; man rpm

humboldtux
Posts: 3
Joined: 2007/02/20 11:01:54

Re: How to know if my os is a 32bits or 64bits one?

Post by humboldtux » 2007/02/20 15:18:01

Thank you lenard for your fast answer.
I have already (badly?) read this manpage and found that the three x86_64 stand for the -m -p and -i switches that seems to have nothing to do with the operating system:
-m, --machine
print the machine hardware name

-p, --processor
print the processor type

-i, --hardware-platform
print the hardware platform

About your second method, it seems possible to have a 64bits os and (stupidly) installing 32bits kernel and libs, with update's --arch= option.

but maybe my bad english and lack of linux knowledge are faulty.

regards

pjwelsh
Posts: 2598
Joined: 2007/01/07 02:18:02
Location: Central IL USA

Re: How to know if my os is a 32bits or 64bits one?

Post by pjwelsh » 2007/02/20 15:35:18

The uname manual page provides the info on what uname can do. Often that is more that you need. That man page will help you to fine tune uname to provide only the info you may want.

[quote]it seems possible to have a 64bits os and (stupidly) installing 32bits kernel and libs, with update's --arch= option.[/quote]

or just tag on the "whatever_package.i386" as part of a "yum install"

Post Reply

Return to “CentOS 4 - Miscellaneous Questions”