"리눅스 32비트 64비트 확인"의 두 판 사이의 차이

4번째 줄: 4번째 줄:


==방법 1: getconf==
==방법 1: getconf==
;명령어
<source lang='dos'>
<source lang='bash'>
[root@jmnote ~]# getconf LONG_BIT
getconf LONG_BIT
32
</source>
</source>
 
:→ 32비트
;실행예시
<source lang='dos'>
<source lang='dos'>
[root@jmnote ~]# getconf LONG_BIT
[root@jmnote ~]# getconf LONG_BIT
32
64
</source>
</source>
결과값은 32 또는 64.
:→ 64비트


==방법 2: uname ==
==방법 2: arch==
;명령어
<source lang='dos'>
<source lang='bash'>
[root@jmnote ~]# arch
uname -m
x86_64
</source>
</source>
*i386 또는 i686이면 32 bit (i386은 매우 구식...)
*x86_64이면 64 bit


;예시
==방법 3: uname ==
<source lang='dos'>
<source lang='dos'>
[root@jmnote ~]# uname -m
[root@jmnote ~]# uname -m
x86_64
x86_64
</source>
</source>
:→ x86_64이므로 64 bit
:→ 만약 i386 또는 i686이면 32 bit (i386은 매우 구식...)


;스크립트
==방법 4: lscpu==
<source lang='bash'>
if [ `uname -m` = "x86_64" ]
then BIT=64
else BIT=32
fi
echo $BIT
</source>
 
;예시
<source lang='dos'>
<source lang='dos'>
[root@jmnote ~]# if [ `uname -m` = "x86_64" ]
[root@jmnote ~]# lscpu | grep ^Arch
> then BIT=64
Architecture:          x86_64
> else BIT=32
> fi
[root@jmnote ~]# echo $BIT
64
</source>
</source>



2014년 1월 23일 (목) 01:17 판

리눅스 비트 확인
리눅스 BIT 확인하기
리눅스가 32비트인지 64비트인지 확인하기

1 방법 1: getconf

[root@jmnote ~]# getconf LONG_BIT
32
→ 32비트
[root@jmnote ~]# getconf LONG_BIT
64
→ 64비트

2 방법 2: arch

[root@jmnote ~]# arch
x86_64

3 방법 3: uname

[root@jmnote ~]# uname -m
x86_64
→ x86_64이므로 64 bit
→ 만약 i386 또는 i686이면 32 bit (i386은 매우 구식...)

4 방법 4: lscpu

[root@jmnote ~]# lscpu | grep ^Arch
Architecture:          x86_64

5 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}