awk 命令相关技巧

检查 CPU 大端小端

echo -n I | od -to2 | awk '{print substr($2,6,1); exit}'

输出为 0 表示为大端架构,为 1 表示为小端架构。