日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

Linux如何使用shell辨別系統(tǒng)位數(shù)

現(xiàn)在絕大多數(shù)用戶使用的是Windows系統(tǒng),都知道Windows系統(tǒng)有分32位和64位,其實(shí)Linux系統(tǒng)也有32位和64位之分,你知道你的Linux系統(tǒng)是幾位的嗎?下面小編就教你如何使用shell查看Linux是32位還是64位 。

Linux如何使用shell辨別系統(tǒng)位數(shù)


手動(dòng)查看系統(tǒng)位數(shù)
查看linux系統(tǒng)位數(shù),可以分別執(zhí)行以下兩個(gè)命令
getconf WORD_BIT
用于獲取word的位數(shù)
getconf LONG_BIT
用于獲取long的位數(shù)
對(duì)于64位系統(tǒng)以上兩個(gè)命令應(yīng)該分別得到32和64 。
判斷l(xiāng)inux系統(tǒng)是32位還是64位有很多方法,推薦用getconf,然而有人認(rèn)為getconf WORD_BIT=32則是32bit,getconf WORD_BIT=64則是64bit,請(qǐng)去64bit機(jī)器上執(zhí)行,呵呵 。getconf WORD_BIT顯示結(jié)果還是32,why?
32位的系統(tǒng)中int類(lèi)型和long類(lèi)型一般都是4字節(jié),64位的系統(tǒng)中int類(lèi)型還是4字節(jié)的,但是long已變成了8字節(jié)inux系統(tǒng)中可
用”getconf WORD_BIT”和”getconf LONG_BIT”獲得word和long的位數(shù)
shell判斷系統(tǒng)位數(shù)
ldconfig
if [ $(getconf WORD_BIT) = ‘32’ ] && [ $(getconf LONG_BIT) = ‘64’ ] ; then
ln -s /usr/local/mysql/lib/mysql /usr/lib64/mysql
else
ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
fi
補(bǔ)充一些其它方法
uname -a
32位:Linux localhost.localdomain 2.6.32-431.17.1.el6.i686 #1 SMP Wed May 7 20:52:21 UTC 2014 i686 i686 i386 GNU/Linux
64位:Linux demolinux 2.6.32-431.11.2.el6.x86_64 #1 SMP Tue Mar 25 19:59:55 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
【Linux如何使用shell辨別系統(tǒng)位數(shù)】 上面就是Linux使用shell查看Linux32位和64位的方法介紹了,除了使用shell查看,你還能手動(dòng)執(zhí)行命令查看系統(tǒng)位數(shù) 。

    推薦閱讀