LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-13-2007, 04:59 PM   #1
seanferd
LQ Newbie
 
Registered: Feb 2006
Distribution: Debian Wheezy
Posts: 13

Rep: Reputation: 0
Command to show CPU Bits?


Hi, I'm running Debian Etch and I'm wondering if there is a command that will list the CPU bits. I'm pretty sure it's 32, but I can't find anything that's concrete. I was suggested whichdist, but it doesn't either. I've tried looking in /proc/cpuinfo and figured the uname command would do it, but no luck. Any help would be appreciated!

Thanks,

Sean
 
Old 06-13-2007, 05:24 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
You want to know what processor you have? .....or the version of Debian?

If you have lshw on your system, that will tell you more about the hardware than you ever wanted to know...
 
Old 06-14-2007, 08:42 AM   #3
seanferd
LQ Newbie
 
Registered: Feb 2006
Distribution: Debian Wheezy
Posts: 13

Original Poster
Rep: Reputation: 0
Yes, I want to know what processor I have. Whether it's 32 or 64 bit is all I really require.
 
Old 06-14-2007, 02:08 PM   #4
dawkcid
Member
 
Registered: May 2007
Location: UK
Distribution: LFS,Slackware,Slamd64,NetBSD
Posts: 102

Rep: Reputation: 15
Try this:

Code:
#include <stdio.h>

int main(void)
{
  printf("This box is %d-bit\n", sizeof(long) * 8);
  return 0;
}
All this does is multiply the size of a long integer by 8. All GNU systems define a long to be equal to the natural word size of the architecture (i.e. 4 bytes on 32-bit, 8 bytes on 64-bit, etc).

If you're not familiar with compiling, just save it as, say, cpubits.c and do

cc -o cpubits cpubits.c

then run it

./cpubits

To check your endian-ness at the same time, try this:

Code:
#include <stdio.h>

int main(void)
{
        int i = 1;
        printf("This box is %d-bit, and is %s-endian.\n", sizeof(long) * 8, *((char*)&i) ? "little" : "big");
        return 0;
}

Last edited by dawkcid; 06-14-2007 at 02:48 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Big Brother won't show CPU or DISK Osiris123d Linux - Software 8 07-29-2010 09:02 PM
32 bits version distros running 64 bits CPU javb Linux - General 4 04-02-2006 07:21 AM
Java 64 bits and applications of 32 bits RGB_mdk Linux - Software 3 06-13-2005 09:05 AM
Need program to show cpu usage, network status and stuff in X....any sugestions? op_stager Linux - Software 3 09-24-2004 07:56 AM
Why does mysqld not show up w/ps command baandar Linux - Software 3 09-01-2004 02:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration