ubutun查看系統版本命令

方法一:cat /etc/issue
           返回結果:方法一:cat /etc/issue
           返回結果:Ubuntu 12.04.4 LTS \n \l

方法二:cat /proc/version
            返回結果:Linux version 3.2.0-35-generic-pae (buildd@aatxe) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #55-Ubuntu SMP Wed Dec 5 18:04:39 UTC 2012

方法三:uname -a
            返回結果:Linux king-Compaq-Presario-CQ40-Notebook-PC 3.2.0-35-generic-pae #55-Ubuntu SMP Wed Dec 5 18:04:39 UTC 2012 i686 i686 i386 GNU/Linux

方法四:lsb_release -a
            返回結果:
                          
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 12.04.1 LTS
Release:    12.04
Codename:    precise


方法五:cat /etc/lsb-release
            返回結果:
                        

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise

DISTRIB_DESCRIPTION="Ubuntu 12.04.1 LTS"


查看系統是64位還是32位:

1、getconf LONG_BIT or getconf WORD_BIT

[root@localhost ~]# getconf LONG_BIT

32

2、file /bin/ls

[root@localhost ~]# file /bin/ls

/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x83531f308f1fa18221be53eaf399303400c14638, stripped

這些命令看似簡單,本人在調試代碼時出現瞭如下錯誤:

cannot execute binary file

找了半天查不出什麼原因,從網上看看各種解決辦法,我在查看版本號及系統位數後終於找到問題原因所在,原來我從64位拷貝的可執行在我的32位機子上運行,不斷的報出了上述錯誤。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章