`

Linux下查看系统的位数和系统信息

阅读更多
对于linux系统,,安装一些软件,,有时候要考虑到linux系统是32位还是64位的系统
可以通过终端输入命令:
1)getconf LONG_BIT可以得到系统的具体位数是32还是64位。
2) uname -a 可得到系统的具体系统

我们时常需要查询系统相关的信息,比如页面大小,整数大小之类,如果编写程序去计算会比较繁琐,这里有一个很有用的命令,可以用来获取系统相关信息。它就是getconf。

$ getconf PAGE_SIZE
4096
$ getconf INT_MAX
2147483647

可以取得的相关信息如下(参考相关资料,在又在版本上会有些不同):
_CS_PATH Value for the PATH environment variable used to find commands.
ARG_MAX Maximum length, in bytes, of the arguments for one of the exec subroutines, including environment data.
BC_BASE_MAX Maximum value allowed for the obase variable with the bc command.
BC_DIM_MAX Maximum number of elements permitted in an array by the bc command.
BC_SCALE_MAX Maximum value allowed for the scale variable with the bc command.
BC_STRING_MAX Maximum length of a string constant accepted by the bc command.
CHARCLASS_NAME_MAX Maximum number of bytes in a character class name.
CHAR_BIT Number of bits in a type character.
CHAR_MAX Maximum value of a type character.
CHAR_MIN Minimum value of a type character.
CHILD_MAX Maximum number of simultaneous processes for each real user ID.
CLK_TCK Number of clock ticks per second returned by the time subroutine.
COLL_WEIGHTS_MAX Maximum number of weights that can be assigned to an entry in the LC_COLLATE locale stanza in a locale-definition file.
CS_PATH Value of the PATH environment variable used to find commands.
EXPR_NEST_MAX Maximum number of expressions that can be nested within parentheses by the expr command.
INT_MAX Maximum value of a type int.
INT_MIN Minimum value of a type int.
LINE_MAX Maximum length, in bytes, of a command's input line (either standard input or another file) when the utility is described as processing text files. The length includes room for the trailing new-line character.
LONG_BIT Number of bits in a type long int.
LONG_MAX Maximum value of a type long int.
LONG_MIN Minimum value of a type long int.
MB_LEN_MAX Maximum number of bytes in a character for any supported locale.
NGROUPS_MAX Maximum number of simultaneous supplementary group IDs for each process.
NL_ARGMAX Maximum value of digit in calls to the printf and scanf subroutines.
NL_LANGMAX Maximum number of bytes in a LANG name.
NL_MSGMAX Maximum message number.
NL_NMAX Maximum number of bytes in an N-to-1 collation mapping.
NL_SETMAX Maximum set number.
NL_TEXTMAX Maximum number of bytes in a message string.
NZERO Default process priority.
OPEN_MAX Maximum number of files that one process can have open at one time.
PATH Sequence of colon-separated path prefixes used to find commands.
RE_DUP_MAX Maximum number of repeated occurrences of a regular expression permitted when using the interval-notation parameters, such as the m and n parameters with the ed command.
SCHAR_MAX Maximum value of a type signed char.
SCHAR_MIN Minimum value of a type signed char.
SHRT_MAX Maximum value of a type short.
SHRT_MIN Minimum value of a type short.
SSIZE_MAX Maximum value of an object of type ssize_t.
STREAM_MAX Number of streams that one process can have open at one time.
TMP_MAX Minimum number of unique path names generated by the tmpnam subroutine. Maximum number of times an application can reliably call the tmpnam subroutine.
TZNAME_MAX Maximum number of bytes supported for the name of a time zone (not the length of the TZ environment variable).
UCHAR_MAX Maximum value of a type unsigned char.
UINT_MAX Maximum value of a type unsigned int.
ULONG_MAX Maximum value of a type unsigned long int.
USHRT_MAX Maximum value of a type unsigned short int.
WORD_BIT Number of bits in a word or type int 
 
分享到:
评论

相关推荐

    Linux下查看操作系统的位数

    绍Linux下查看操作系统的位数

    查看linux系统版本,内核,CPU,MEM,位数的相关命令.docx

    查看linux系统版本,内核,CPU,MEM,位数的相关命令.docx查看linux系统版本,内核,CPU,MEM,位数的相关命令.docx

    nodejs在linux安装教程-包涵判断当前版本是32位还是64位.pdf

    在Linux系统上安装Node.js需要先判断当前系统的版本,因为Node.js有32位和64位两种版本,需要选择与当前系统版本相匹配的安装包。该文件详细介绍了如何使用命令行工具来判断当前系统的版本,包括查看CPU信息、查看...

    Linux读取U盘或者移动硬盘序列号并获取U盘或者移动硬盘分区名

    完整代码,可直接编译和测试,嵌入式环境下也是适应的。 在linux测试如下,id表示序列号,sdb1表示是分区名称: # ./a.out udisk dev num:0 udisk id:055CE21B ret:0 dev num:0 found dir:0:0:0:1 found dev dir:0:...

    Linux下如何查看版本信息的方法步骤

    Linux下如何查看版本信息, 包括位数、版本信息以及CPU内核信息、CPU具体型号等等,整个CPU信息一目了然。 1、# uname -a (Linux查看版本当前操作系统内核信息) Linux localhost.localdomain 2.4.20-8 #1 Thu ...

    RedHat系列以及Debian系的linux硬件信息查看命令

    内容包括查看系统位数、操作系统版本、内核版本、系统架构内核、物理CPU个数、逻辑CPU个数、CPU的核数、总线程数量、服务器内存、系统中所有的的磁盘(包括挂载和未挂载)、系统硬盘使用空间等,适用于云计算领域...

    linux下的mysql维护说明书.pdf

    linux下查看系统的版本,位数 //查看linux的版本信息 //查看LSB本身的版本信息 //Kernel版本 查看mysql 安装路径 mysql为例。比如说我安装了mysql,但是不知道文件都安装在哪些地方、放在哪些文

    C语言深层探索+ARM linux移植

    基于ARM的嵌入式Linux移植真实体验(3)――操作系统 110 基于ARM的嵌入式Linux移植真实体验(4)――设备驱动 119 基于ARM的嵌入式Linux移植真实体验(5)――应用实例 136 C/C++结构体的一个高级特性――指定成员...

    Linux命令笔记

    8:查看当前Linux系统的发行版本 语法: lsb_release -a 9:lsof列出进程打开或使用的文件信息 语法: lsof [选项] 10:date 第六部分:服务管理 1:服务简介与分类 2:RPM包安装服务的管理 2.1:独立服务的管理 2.2:...

    查看Linux系统是32位还是64位的方法总结

    主要介绍了查看Linux系统是32位还是64位的方法总结,非常不错,具有参考借鉴价值,需要的朋友可以参考下

    Linux上部署项目的要求:1.参考相关资料,能够在Linux上成功部署项目即可 2.必须掌握Linux的基本命令

    6.uname -a :查看linux系统的基本信息(计算机名,操作的位数,版本号) 7.ll :用来查看当前目录下的所有文件资源。ls 查看当前目录下所有文件名称 8.mkdir 目录名:创建文件夹 9. vi 文件名:对指定的文件名进行...

    linux环境下mongodb配置文档及安装包

    linux环境下mongodb配置文档及安装包,安装之前一定要检查系统是多少位的,MongoDb区分位数使用 getconf LONG_BIT 命令查看

    rsync跨系统配置

    rsync跨系统配置,可实现linux to linux 以及linux to windows等

    获取Linux系统资源信息的shell脚本

    获取操作系统基本信息(CPU、内存、位数、内核、网卡、IP地址、磁盘、防火墙、CPUspeed状态、sshd状态、JAVA虚拟机版本、GCC版本等)

    linux c 语言串口调试

    用于linux 环境下c语言串口编程编程接收,发送,波特率配置。尤其对于接收串口数据必须采用无符号类型的字符数组去接收 一整行为例说明 整型的每一种都有无符号(unsigned)和有符号(signed)两种类型,在默认情况...

    判断Unix系统及库文件是32位还是64位的详解

    一、查看系统32还是64位系统 bootinfo -y 查看硬件位数 bootinfo -K 查看内核位数 二、查看库文件是32位还是64位 1、使用file命令 Linux: # file libnss1_files-2.2.4.so libnss1_files-2.2.4.so: ELF 32-...

    jdk-8u152-linux-arm32-vfp-hflt.tar.gz

    Linux下的java:cannot execute binary file: Exec format error,系统位数无误,有可能你玩儿的是树莓派。

    sapjco3-windows64-linux64 SAP社区完整版

    自己找了好久的资源,这里提供windows64位和linux64服务器版,sapjco版本为3.0.9,java连接sap系统需要通过sap javaconnect来连接,对于sapjco3.jar系列文件有32位与64位之分。 1)将相对应位数的sapjco3.dll文件拷贝...

    查看Linux系统硬件信息

    lscpu命令,查看的是cpu的统计信息,只列出一部分,如位数,核心数,缓存大小,频率。  Architecture: x86_64  CPU op-mode(s): 32-bit, 64-bit  Byte Order: Little Endian  CPU(s): 2  CPU MHz: ...

    C 语言嵌入式系统编程修炼

    C/C++结构体的一个高级特性――指定成员的位数 C/C++中的近指令、远指针和巨指针 从两道经典试题谈 C/C++中联合体(union)的使用 基于 ARM 的嵌入式 Linux 移植真实体验 深入浅出 Linux 设备驱动编程

Global site tag (gtag.js) - Google Analytics