Linux下查看系统的位数和系统信息
对于linux系统,,安装一些软件,,有时候要考虑到linux系统是32位还是64位的系统
可以通过终端输入命令:
1)getconfLONG_BIT可以得到系统的具体位数是32还是64位。
2)uname-a可得到系统的具体系统
我们时常需要查询系统相关的信息,比如页面大小,整数大小之类,如果编写程序去计算会比较繁琐,这里有一个很有用的命令,可以用来获取系统相关信息。它就是getconf。
$getconfPAGE_SIZE
4096
$getconfINT_MAX
2147483647
可以取得的相关信息如下(参考相关资料,在又在版本上会有些不同):
_CS_PATHValueforthePATHenvironmentvariableusedtofindcommands.
ARG_MAXMaximumlength,inbytes,oftheargumentsforoneoftheexecsubroutines,includingenvironmentdata.
BC_BASE_MAXMaximumvalueallowedfortheobasevariablewiththebccommand.
BC_DIM_MAXMaximumnumberofelementspermittedinanarraybythebccommand.
BC_SCALE_MAXMaximumvalueallowedforthescalevariablewiththebccommand.
BC_STRING_MAXMaximumlengthofastringconstantacceptedbythebccommand.
CHARCLASS_NAME_MAXMaximumnumberofbytesinacharacterclassname.
CHAR_BITNumberofbitsinatypecharacter.
CHAR_MAXMaximumvalueofatypecharacter.
CHAR_MINMinimumvalueofatypecharacter.
CHILD_MAXMaximumnumberofsimultaneousprocessesforeachrealuserID.
CLK_TCKNumberofclocktickspersecondreturnedbythetimesubroutine.
COLL_WEIGHTS_MAXMaximumnumberofweightsthatcanbeassignedtoanentryintheLC_COLLATElocalestanzainalocale-definitionfile.
CS_PATHValueofthePATHenvironmentvariableusedtofindcommands.
EXPR_NEST_MAXMaximumnumberofexpressionsthatcanbenestedwithinparenthesesbytheexprcommand.
INT_MAXMaximumvalueofatypeint.
INT_MINMinimumvalueofatypeint.
LINE_MAXMaximumlength,inbytes,ofacommand'sinputline(eitherstandardinputoranotherfile)whentheutilityisdescribedasprocessingtextfiles.Thelengthincludesroomforthetrailingnew-linecharacter.
LONG_BITNumberofbitsinatypelongint.
LONG_MAXMaximumvalueofatypelongint.
LONG_MINMinimumvalueofatypelongint.
MB_LEN_MAXMaximumnumberofbytesinacharacterforanysupportedlocale.
NGROUPS_MAXMaximumnumberofsimultaneoussupplementarygroupIDsforeachprocess.
NL_ARGMAXMaximumvalueofdigitincallstotheprintfandscanfsubroutines.
NL_LANGMAXMaximumnumberofbytesinaLANGname.
NL_MSGMAXMaximummessagenumber.
NL_NMAXMaximumnumberofbytesinanN-to-1collationmapping.
NL_SETMAXMaximumsetnumber.
NL_TEXTMAXMaximumnumberofbytesinamessagestring.
NZERODefaultprocesspriority.
OPEN_MAXMaximumnumberoffilesthatoneprocesscanhaveopenatonetime.
PATHSequenceofcolon-separatedpathprefixesusedtofindcommands.
RE_DUP_MAXMaximumnumberofrepeatedoccurrencesofaregularexpressionpermittedwhenusingtheinterval-notationparameters,suchasthemandnparameterswiththeedcommand.
SCHAR_MAXMaximumvalueofatypesignedchar.
SCHAR_MINMinimumvalueofatypesignedchar.
SHRT_MAXMaximumvalueofatypeshort.
SHRT_MINMinimumvalueofatypeshort.
SSIZE_MAXMaximumvalueofanobjectoftypessize_t.
STREAM_MAXNumberofstreamsthatoneprocesscanhaveopenatonetime.
TMP_MAXMinimumnumberofuniquepathnamesgeneratedbythetmpnamsubroutine.Maximumnumberoftimesanapplicationcanreliablycallthetmpnamsubroutine.
TZNAME_MAXMaximumnumberofbytessupportedforthenameofatimezone(notthelengthoftheTZenvironmentvariable).
UCHAR_MAXMaximumvalueofatypeunsignedchar.
UINT_MAXMaximumvalueofatypeunsignedint.
ULONG_MAXMaximumvalueofatypeunsignedlongint.
USHRT_MAXMaximumvalueofatypeunsignedshortint.
WORD_BITNumberofbitsinawordortypeint