技术小黑屋

How to Determine Whether a System Is 64-bit or 32-bit

A trick in Bash

1
2
3
4
5
6
7
8
#!/bin/bash
system_bits=`uname -m`
if [[ "$system_bits" == x86_64  ]]
then
    echo "It's a 64-bit system"
else
    echo "It's a 32-bit system"
fi

Others

我的博客即将搬运同步至腾讯云+社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=2t07a740wrok0


我的知乎 Live 推荐