How to determine the number of system digits-general Linux technology-Linux programming and kernel information. The following is a detailed description. How to view the number of digits in a Linux operating system
1. Programming implementation:
Return the value of sizeof (int) in the program. The returned result is the number of bytes in the operating system. If 4 is returned, it is a 32-bit operating system, and 8 is 64-bit.
2.2.getconf command:
The getconf command can obtain basic system configuration information, such as the number of operating systems, memory size, and disk size.
Example: getconf LONG_BIT
3. uname-
4 uname-m | sed-e's/I .86/32/'. If it is 32, it is a 32-bit server. If it is 64, It is a 64-bit server. Unconfirmed, to be examined
Strange: The above command getconf LONG_BIT is used to view the number of digits of the operating system. In addition, the number of digits of the hardware to be viewed together on the internet is getconf HARDWARE_BITMODE, but the message getconf is always prompted: unrecognized variable 'hardware _ bitmode'. Why?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service