查看linux系统是多少位,使用 getconf LONG_BIT echo $HOSTTYPE

本文介绍了如何在Linux系统中查看其位数,包括使用getconf LONG_BIT, HOSTTYPE和uname -a命令的方法。

转载自:http://hi.baidu.com/szbruce/item/3009851c5520ef0de65c3624

查看系统多少位
网上很多种说话   ### getconf WORD_BIT 错误的

这3个是对的    
    getconf LONG_BIT
    echo $HOSTTYPE

uname -a 
64位的显示
Linux ps4 2.6.16.46-0.12-smp #1 SMP Thu May 17 14:00:09 UTC 2007 x86_64 x86_64 x86_64 GNU/Linux
后面显示有 x86_64

32位的显示:
Linux fc6 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:54:20 EDT 2006 i686 i686 i386 GNU/Linux


[Info ] 2025-05-13 15:18:03.817 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][Remote -SSH(TRAE)] activated [Info ] 2025-05-13 15:18:03.836 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702]Resolving ssh remote authority 'ssh-remote+7b22686f73744e616d65223a223139322e3136382e33312e3339227d' (attemp #1) [Info ] 2025-05-13 15:18:03.883 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702]Initiating SSH connection [Debug] 2025-05-13 15:18:04.378 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V" [Debug] 2025-05-13 15:18:04.413 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH] stderr> OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2 [Debug] 2025-05-13 15:18:04.413 +08:00 [Info ] 2025-05-13 15:18:04.416 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH:LocalServer] Connecting to 192.168.31.39 [Info ] 2025-05-13 15:18:04.416 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH:LocalServer] Full SSH command: C:\Windows\System32\OpenSSH\ssh.exe -T -D 57335 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o RemoteCommand=bash -l -c "exec bash --norc" 192.168.31.39 [Info ] 2025-05-13 15:18:04.416 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH:Connection] SSH:Connection event: beforeconnect [Info ] 2025-05-13 15:18:04.418 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH AskPass] Pipe listening: \\.\pipe\trae-askpass-f4eba673c8e04dbaa55fb3909c6dfe1d1144f93b [Info ] 2025-05-13 15:18:04.418 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH AskPass] askpass script: d:\TRAE\Trae CN\resources\app\extensions\icube-remote-ssh\out\askpass-main.js [Info ] 2025-05-13 15:18:04.420 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH:LocalServer] AskPass environment variables set: {"SSH_ASKPASS":"C:\\Users\\2333\\AppData\\Local\\Temp\\trae-ssh-askpass-y9qwarzi\\askpass.bat","SSH_ASKPASS_REQUIRE":"force","DISPLAY":"0","VSCODE_SSH_ASKPASS_NODE":"D:\\TRAE\\Trae CN\\Trae CN.exe","VSCODE_SSH_ASKPASS_MAIN":"d:\\TRAE\\Trae CN\\resources\\app\\extensions\\icube-remote-ssh\\out\\askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"\\\\.\\pipe\\trae-askpass-f4eba673c8e04dbaa55fb3909c6dfe1d1144f93b","VSCODE_SSH_ASKPASS_EXTRA_ARGS":""} [Info ] 2025-05-13 15:18:04.547 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][Local Server] stdout: local-server-2333@192.168.31.39> Running ssh connection command: C:\Windows\System32\OpenSSH\ssh.exe -T -D 57335 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o RemoteCommand=bash -l -c "exec bash --norc" 192.168.31.39 [Info ] 2025-05-13 15:18:04.547 +08:00 [Info ] 2025-05-13 15:18:04.553 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][Local Server] stdout: local-server-2333@192.168.31.39> Spawned ssh, pid=14056 [Info ] 2025-05-13 15:18:04.553 +08:00 [Info ] 2025-05-13 15:18:04.711 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][Local Server] stderr: Warning: Permanently added '192.168.31.39' (ED25519) to the list of known hosts. [Info ] 2025-05-13 15:18:04.711 +08:00 [Info ] 2025-05-13 15:18:04.939 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH:LocalServer] localServerProcess is ready, executing remote script [Info ] 2025-05-13 15:18:04.941 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH:Connection] Authentication required: {"type":"password","request":"dingshuhang@192.168.31.39's password: "} [Info ] 2025-05-13 15:18:36.667 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][Local Server] stdout: ready: c7e8d689b293 [Info ] 2025-05-13 15:18:36.667 +08:00 [Info ] 2025-05-13 15:18:36.667 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][Local Server] stdout: Linux cmcs232-System-Product-Name 6.8.0-59-generic #61~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 15 17:03:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux [Info ] 2025-05-13 15:18:36.667 +08:00 /bin/bash [Info ] 2025-05-13 15:18:36.667 +08:00 c7e8d689b293: running [Info ] 2025-05-13 15:18:36.667 +08:00 [Info ] 2025-05-13 15:18:36.668 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH:Connection] SSH:Connection event: connect [Info ] 2025-05-13 15:18:36.668 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH:Resolver] Connection established successfully [Info ] 2025-05-13 15:18:36.668 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702]SSH:Connection connection established [Info ] 2025-05-13 15:18:36.681 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH:ExecPartial] Executing command: bash --noprofile --norc -c '#!/usr/bin/env sh [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 KERNEL="$(uname -s)" [Info ] 2025-05-13 15:18:36.681 +08:00 case $KERNEL in [Info ] 2025-05-13 15:18:36.681 +08:00 Darwin) [Info ] 2025-05-13 15:18:36.681 +08:00 PLATFORM="darwin" [Info ] 2025-05-13 15:18:36.681 +08:00 ;; [Info ] 2025-05-13 15:18:36.681 +08:00 Linux) [Info ] 2025-05-13 15:18:36.681 +08:00 PLATFORM="linux" [Info ] 2025-05-13 15:18:36.681 +08:00 ;; [Info ] 2025-05-13 15:18:36.681 +08:00 FreeBSD) [Info ] 2025-05-13 15:18:36.681 +08:00 PLATFORM="freebsd" [Info ] 2025-05-13 15:18:36.681 +08:00 ;; [Info ] 2025-05-13 15:18:36.681 +08:00 DragonFly) [Info ] 2025-05-13 15:18:36.681 +08:00 PLATFORM="dragonfly" [Info ] 2025-05-13 15:18:36.681 +08:00 ;; [Info ] 2025-05-13 15:18:36.681 +08:00 *) [Info ] 2025-05-13 15:18:36.681 +08:00 echo "Error platform not supported: $KERNEL" [Info ] 2025-05-13 15:18:36.681 +08:00 exit 1 [Info ] 2025-05-13 15:18:36.681 +08:00 ;; [Info ] 2025-05-13 15:18:36.681 +08:00 esac [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 ARCH="$(uname -m)" [Info ] 2025-05-13 15:18:36.681 +08:00 case $ARCH in [Info ] 2025-05-13 15:18:36.681 +08:00 x86_64 | amd64) [Info ] 2025-05-13 15:18:36.681 +08:00 SERVER_ARCH="x64" [Info ] 2025-05-13 15:18:36.681 +08:00 ;; [Info ] 2025-05-13 15:18:36.681 +08:00 armv7l | armv8l) [Info ] 2025-05-13 15:18:36.681 +08:00 SERVER_ARCH="armhf" [Info ] 2025-05-13 15:18:36.681 +08:00 ;; [Info ] 2025-05-13 15:18:36.681 +08:00 arm64 | aarch64) [Info ] 2025-05-13 15:18:36.681 +08:00 SERVER_ARCH="arm64" [Info ] 2025-05-13 15:18:36.681 +08:00 ;; [Info ] 2025-05-13 15:18:36.681 +08:00 ppc64le) [Info ] 2025-05-13 15:18:36.681 +08:00 SERVER_ARCH="ppc64le" [Info ] 2025-05-13 15:18:36.681 +08:00 ;; [Info ] 2025-05-13 15:18:36.681 +08:00 riscv64) [Info ] 2025-05-13 15:18:36.681 +08:00 SERVER_ARCH="riscv64" [Info ] 2025-05-13 15:18:36.681 +08:00 ;; [Info ] 2025-05-13 15:18:36.681 +08:00 loongarch64) [Info ] 2025-05-13 15:18:36.681 +08:00 SERVER_ARCH="loong64" [Info ] 2025-05-13 15:18:36.681 +08:00 ;; [Info ] 2025-05-13 15:18:36.681 +08:00 s390x) [Info ] 2025-05-13 15:18:36.681 +08:00 SERVER_ARCH="s390x" [Info ] 2025-05-13 15:18:36.681 +08:00 ;; [Info ] 2025-05-13 15:18:36.681 +08:00 *) [Info ] 2025-05-13 15:18:36.681 +08:00 echo "Error architecture not supported: $ARCH" [Info ] 2025-05-13 15:18:36.681 +08:00 exit 1 [Info ] 2025-05-13 15:18:36.681 +08:00 ;; [Info ] 2025-05-13 15:18:36.681 +08:00 esac [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 OS_RELEASE_ID="$(grep -i '\''^ID='\'' /etc/os-release 2>/dev/null | sed '\''s/^ID=//gi'\'' | sed '\''s/"//g'\'')" [Info ] 2025-05-13 15:18:36.681 +08:00 if [ -z "$OS_RELEASE_ID" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 OS_RELEASE_ID="$(grep -i '\''^ID='\'' /usr/lib/os-release 2>/dev/null | sed '\''s/^ID=//gi'\'' | sed '\''s/"//g'\'')" [Info ] 2025-05-13 15:18:36.681 +08:00 if [ -z "$OS_RELEASE_ID" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 OS_RELEASE_ID="unknown" [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 OS_VERSION_ID="$(grep -i '\''^VERSION_ID='\'' /etc/os-release 2>/dev/null | sed '\''s/^VERSION_ID=//gi'\'' | sed '\''s/"//g'\'')" [Info ] 2025-05-13 15:18:36.681 +08:00 if [ -z "$OS_VERSION_ID" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 OS_VERSION_ID="$(grep -i '\''^VERSION_ID='\'' /usr/lib/os-release 2>/dev/null | sed '\''s/^VERSION_ID=//gi'\'' | sed '\''s/"//g'\'')" [Info ] 2025-05-13 15:18:36.681 +08:00 if [ -z "$OS_VERSION_ID" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 OS_VERSION_ID="unknown" [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 GLIBC_VERSION="" [Info ] 2025-05-13 15:18:36.681 +08:00 if [ "$OS_ID" = "alpine" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 echo "Warning: alpine distro detected, skipping GLIBC check" [Info ] 2025-05-13 15:18:36.681 +08:00 GLIBC_VERSION="musl" [Info ] 2025-05-13 15:18:36.681 +08:00 elif [ -z "$(ldd --version 2>&1 | grep '\''musl libc'\'')" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 if [ -f /sbin/ldconfig ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 # Look up path [Info ] 2025-05-13 15:18:36.681 +08:00 libc_paths=$(/sbin/ldconfig -p | grep '\''libc.so.6'\'') [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 if [ "$(echo "$libc_paths" | wc -l)" -gt 1 ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 case $ARCH in [Info ] 2025-05-13 15:18:36.681 +08:00 x86_64) LDCONFIG_ARCH="x86-64";; [Info ] 2025-05-13 15:18:36.681 +08:00 armv7l | armv8l) LDCONFIG_ARCH="hard-float";; [Info ] 2025-05-13 15:18:36.681 +08:00 arm64 | aarch64) [Info ] 2025-05-13 15:18:36.681 +08:00 BITNESS=$(getconf LONG_BIT) [Info ] 2025-05-13 15:18:36.681 +08:00 if [ "$BITNESS" = "32" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 # Can have 32-bit userland on 64-bit kernel [Info ] 2025-05-13 15:18:36.681 +08:00 LDCONFIG_ARCH="hard-float" [Info ] 2025-05-13 15:18:36.681 +08:00 else [Info ] 2025-05-13 15:18:36.681 +08:00 LDCONFIG_ARCH="AArch64" [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 ;; [Info ] 2025-05-13 15:18:36.681 +08:00 esac [Info ] 2025-05-13 15:18:36.681 +08:00 libc_path=$(echo "$libc_paths" | grep "$LDCONFIG_ARCH" | awk '\''{print $NF}'\'') [Info ] 2025-05-13 15:18:36.681 +08:00 else [Info ] 2025-05-13 15:18:36.681 +08:00 libc_path=$(echo "$libc_paths" | awk '\''{print $NF}'\'') [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 elif [ -f /usr/lib/libc.so.6 ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 # Typical path [Info ] 2025-05-13 15:18:36.681 +08:00 libc_path='\''/usr/lib/libc.so.6'\'' [Info ] 2025-05-13 15:18:36.681 +08:00 elif [ -f /lib64/libc.so.6 ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 # Typical path (OpenSUSE) [Info ] 2025-05-13 15:18:36.681 +08:00 libc_path='\''/lib64/libc.so.6'\'' [Info ] 2025-05-13 15:18:36.681 +08:00 elif [ -f /usr/lib64/libc.so.6 ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 # Typical path [Info ] 2025-05-13 15:18:36.681 +08:00 libc_path='\''/usr/lib64/libc.so.6'\'' [Info ] 2025-05-13 15:18:36.681 +08:00 else [Info ] 2025-05-13 15:18:36.681 +08:00 echo "Warning: Can'\''t find libc.so or ldconfig, can'\''t verify libc version" [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 while [ -n "$libc_path" ]; do [Info ] 2025-05-13 15:18:36.681 +08:00 # Rather than trusting the output of ldd --version (which is not always accurate) [Info ] 2025-05-13 15:18:36.681 +08:00 # we instead use the version of the cached libc.so.6 file itself. [Info ] 2025-05-13 15:18:36.681 +08:00 libc_path_line=$(echo "$libc_path" | head -n1) [Info ] 2025-05-13 15:18:36.681 +08:00 libc_real_path=$(readlink -f "$libc_path_line" 2>/dev/null || echo "$libc_path_line") [Info ] 2025-05-13 15:18:36.681 +08:00 libc_version=$(cat "$libc_real_path" 2>/dev/null | sed -n '\''s/.*release version \([0-9]\+\.[0-9]\+\).*/\1/p'\'') [Info ] 2025-05-13 15:18:36.681 +08:00 if [ -n "$libc_version" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 GLIBC_VERSION="$libc_version" [Info ] 2025-05-13 15:18:36.681 +08:00 break [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 libc_path=$(echo "$libc_path" | tail -n +2) # remove first line [Info ] 2025-05-13 15:18:36.681 +08:00 done [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 if [ -z "$GLIBC_VERSION" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 if command -v ldd >/dev/null 2>&1; then [Info ] 2025-05-13 15:18:36.681 +08:00 GLIBC_VERSION=$(ldd --version 2>&1 | grep -i "GLIBC|GNU C" | head -n1 | grep -oE '\''[0-9]+\.[0-9]+'\'' | head -n1) [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 if [ -z "$GLIBC_VERSION" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 GLIBC_VERSION="unknown" [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 else [Info ] 2025-05-13 15:18:36.681 +08:00 echo "Warning: musl detected, skipping GLIBC check" [Info ] 2025-05-13 15:18:36.681 +08:00 GLIBC_VERSION="musl" [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 GLIBCXX_VERSION="" [Info ] 2025-05-13 15:18:36.681 +08:00 if [ "$OS_ID" != "alpine" ] && [ -z "$(ldd --version 2>&1 | grep '\''musl libc'\'')" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 if [ -f /sbin/ldconfig ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 # Look up path [Info ] 2025-05-13 15:18:36.681 +08:00 case $ARCH in [Info ] 2025-05-13 15:18:36.681 +08:00 x86_64) LDCONFIG_ARCH="x86-64";; [Info ] 2025-05-13 15:18:36.681 +08:00 armv7l | armv8l) LDCONFIG_ARCH="hard-float";; [Info ] 2025-05-13 15:18:36.681 +08:00 arm64 | aarch64) [Info ] 2025-05-13 15:18:36.681 +08:00 BITNESS=$(getconf LONG_BIT) [Info ] 2025-05-13 15:18:36.681 +08:00 if [ "$BITNESS" = "32" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 LDCONFIG_ARCH="hard-float" [Info ] 2025-05-13 15:18:36.681 +08:00 else [Info ] 2025-05-13 15:18:36.681 +08:00 LDCONFIG_ARCH="AArch64" [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 ;; [Info ] 2025-05-13 15:18:36.681 +08:00 esac [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 libstdcpp_paths=$(/sbin/ldconfig -p | grep '\''libstdc++.so.6'\'') [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 if [ "$(echo "$libstdcpp_paths" | wc -l)" -gt 1 ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 libstdcpp_path=$(echo "$libstdcpp_paths" | grep "$LDCONFIG_ARCH" | awk '\''{print $NF}'\'') [Info ] 2025-05-13 15:18:36.681 +08:00 else [Info ] 2025-05-13 15:18:36.681 +08:00 libstdcpp_path=$(echo "$libstdcpp_paths" | awk '\''{print $NF}'\'') [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 elif [ -f /usr/lib/libstdc++.so.6 ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 # Typical path [Info ] 2025-05-13 15:18:36.681 +08:00 libstdcpp_path='\''/usr/lib/libstdc++.so.6'\'' [Info ] 2025-05-13 15:18:36.681 +08:00 elif [ -f /usr/lib64/libstdc++.so.6 ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 # Typical path [Info ] 2025-05-13 15:18:36.681 +08:00 libstdcpp_path='\''/usr/lib64/libstdc++.so.6'\'' [Info ] 2025-05-13 15:18:36.681 +08:00 else [Info ] 2025-05-13 15:18:36.681 +08:00 echo "Warning: Can'\''t find libstdc++.so or ldconfig, can'\''t verify libstdc++ version" [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 while [ -n "$libstdcpp_path" ]; do [Info ] 2025-05-13 15:18:36.681 +08:00 libstdcpp_path_line=$(echo "$libstdcpp_path" | head -n1) [Info ] 2025-05-13 15:18:36.681 +08:00 libstdcpp_real_path=$(readlink -f "$libstdcpp_path_line" 2>/dev/null || echo "$libstdcpp_path_line") [Info ] 2025-05-13 15:18:36.681 +08:00 libstdcpp_version=$(grep -ao '\''GLIBCXX_[0-9]*\.[0-9]*\.[0-9]*'\'' "$libstdcpp_real_path" 2>/dev/null | sort -V | tail -1) [Info ] 2025-05-13 15:18:36.681 +08:00 if [ -n "$libstdcpp_version" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 GLIBCXX_VERSION=$(echo "$libstdcpp_version" | sed '\''s/GLIBCXX_//'\'') [Info ] 2025-05-13 15:18:36.681 +08:00 break [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 libstdcpp_path=$(echo "$libstdcpp_path" | tail -n +2) # remove first line [Info ] 2025-05-13 15:18:36.681 +08:00 done [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 if [ -z "$GLIBCXX_VERSION" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 GLIBCXX_VERSION="unknown" [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 OS_ID="$(grep -i '\''^ID='\'' /etc/os-release 2>/dev/null | sed '\''s/^ID=//gi'\'' | sed '\''s/"//g'\'')" [Info ] 2025-05-13 15:18:36.681 +08:00 if [ -z "$OS_ID" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 OS_ID="$(grep -i '\''^ID='\'' /usr/lib/os-release 2>/dev/null | sed '\''s/^ID=//gi'\'' | sed '\''s/"//g'\'')" [Info ] 2025-05-13 15:18:36.681 +08:00 if [ -z "$OS_ID" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 OS_ID="unknown" [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 CONSUL_DATACENTER="" [Info ] 2025-05-13 15:18:36.681 +08:00 if [ -f "/opt/tmp/consul_agent/datacenter" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 CONSUL_DATACENTER=$(cat "/opt/tmp/consul_agent/datacenter" | tr -d '\''[:space:]'\'') [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 check_region() { [Info ] 2025-05-13 15:18:36.681 +08:00 temp_file1=$(mktemp) [Info ] 2025-05-13 15:18:36.681 +08:00 temp_file2=$(mktemp) [Info ] 2025-05-13 15:18:36.681 +08:00 local region="" [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 curl -s -X POST https://api.trae.ai/cloudide/api/v3/trae/GetLoginGuidanceForBytedance > "$temp_file1" & pid1=$! [Info ] 2025-05-13 15:18:36.681 +08:00 curl -s -X POST https://api.trae.com.cn/cloudide/api/v3/trae/GetLoginGuidanceForBytedance > "$temp_file2" & pid2=$! [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 while true; do [Info ] 2025-05-13 15:18:36.681 +08:00 if [ -s "$temp_file1" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 kill $pid2 2>/dev/null [Info ] 2025-05-13 15:18:36.681 +08:00 region=$(cat "$temp_file1" | grep -o '\''"Region":"[^"]*"'\'' | sed '\''s/"Region":"\([^"]*\)"/\1/'\'') [Info ] 2025-05-13 15:18:36.681 +08:00 break [Info ] 2025-05-13 15:18:36.681 +08:00 elif [ -s "$temp_file2" ]; then [Info ] 2025-05-13 15:18:36.681 +08:00 kill $pid1 2>/dev/null [Info ] 2025-05-13 15:18:36.681 +08:00 region=$(cat "$temp_file2" | grep -o '\''"Region":"[^"]*"'\'' | sed '\''s/"Region":"\([^"]*\)"/\1/'\'') [Info ] 2025-05-13 15:18:36.681 +08:00 break [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 if ! kill -0 $pid1 2>/dev/null && ! kill -0 $pid2 2>/dev/null; then [Info ] 2025-05-13 15:18:36.681 +08:00 break [Info ] 2025-05-13 15:18:36.681 +08:00 fi [Info ] 2025-05-13 15:18:36.681 +08:00 sleep 0.1 [Info ] 2025-05-13 15:18:36.681 +08:00 done [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 rm -f "$temp_file1" "$temp_file2" [Info ] 2025-05-13 15:18:36.681 +08:00 echo "$region" | tr -d '\''[:space:]'\'' [Info ] 2025-05-13 15:18:36.681 +08:00 } [Info ] 2025-05-13 15:18:36.681 +08:00 REGION=$(check_region) [Info ] 2025-05-13 15:18:36.681 +08:00 [Info ] 2025-05-13 15:18:36.681 +08:00 echo "PLATFORM=$PLATFORM" [Info ] 2025-05-13 15:18:36.681 +08:00 echo "ARCH=$ARCH" [Info ] 2025-05-13 15:18:36.681 +08:00 echo "SERVER_ARCH=$SERVER_ARCH" [Info ] 2025-05-13 15:18:36.681 +08:00 echo "OS_RELEASE_ID=$OS_RELEASE_ID" [Info ] 2025-05-13 15:18:36.681 +08:00 echo "OS_VERSION_ID=$OS_VERSION_ID" [Info ] 2025-05-13 15:18:36.681 +08:00 echo "OS_ID=$OS_ID" [Info ] 2025-05-13 15:18:36.681 +08:00 echo "GLIBC_VERSION=$GLIBC_VERSION" [Info ] 2025-05-13 15:18:36.681 +08:00 echo "GLIBCXX_VERSION=$GLIBCXX_VERSION" [Info ] 2025-05-13 15:18:36.681 +08:00 echo "RUNTIME_IDC_NAME=$RUNTIME_IDC_NAME" [Info ] 2025-05-13 15:18:36.681 +08:00 echo "CONSUL_DATACENTER=$CONSUL_DATACENTER" [Info ] 2025-05-13 15:18:36.681 +08:00 echo "BYTED_HOST_IP=$BYTED_HOST_IP" [Info ] 2025-05-13 15:18:36.681 +08:00 echo "BYTED_HOST_IPV6=$BYTED_HOST_IPV6" [Info ] 2025-05-13 15:18:36.681 +08:00 echo "REGION=$REGION" [Info ] 2025-05-13 15:18:36.681 +08:00 echo "==check-remote-system.sh=finish==" [Info ] 2025-05-13 15:18:36.681 +08:00 ' [Info ] 2025-05-13 15:18:36.740 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][Local Server] stderr: environment: 行 203: curl: 未找到命令 [Info ] 2025-05-13 15:18:36.740 +08:00 [Info ] 2025-05-13 15:18:36.740 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH:ExecPartial] stderr: environment: 行 203: curl: 未找到命令 [Info ] 2025-05-13 15:18:36.740 +08:00 [Info ] 2025-05-13 15:18:36.752 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][Local Server] stderr: environment: 行 204: curl: 未找到命令 [Info ] 2025-05-13 15:18:36.752 +08:00 [Info ] 2025-05-13 15:18:36.752 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH:ExecPartial] stderr: environment: 行 204: curl: 未找到命令 [Info ] 2025-05-13 15:18:36.752 +08:00 [Info ] 2025-05-13 15:18:36.857 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][Local Server] stdout: PLATFORM=linux [Info ] 2025-05-13 15:18:36.857 +08:00 ARCH=x86_64 [Info ] 2025-05-13 15:18:36.857 +08:00 SERVER_ARCH=x64 [Info ] 2025-05-13 15:18:36.857 +08:00 OS_RELEASE_ID=ubuntu [Info ] 2025-05-13 15:18:36.857 +08:00 [Info ] 2025-05-13 15:18:36.858 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH:ExecPartial] stdout: PLATFORM=linux [Info ] 2025-05-13 15:18:36.858 +08:00 ARCH=x86_64 [Info ] 2025-05-13 15:18:36.858 +08:00 SERVER_ARCH=x64 [Info ] 2025-05-13 15:18:36.858 +08:00 OS_RELEASE_ID=ubuntu [Info ] 2025-05-13 15:18:36.858 +08:00 [Info ] 2025-05-13 15:18:36.858 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][Local Server] stdout: OS_VERSION_ID=22.04 [Info ] 2025-05-13 15:18:36.858 +08:00 OS_ID=ubuntu [Info ] 2025-05-13 15:18:36.858 +08:00 GLIBC_VERSION=2.35 [Info ] 2025-05-13 15:18:36.858 +08:00 GLIBCXX_VERSION=3.4.30 [Info ] 2025-05-13 15:18:36.858 +08:00 RUNTIME_IDC_NAME= [Info ] 2025-05-13 15:18:36.858 +08:00 CONSUL_DATACENTER= [Info ] 2025-05-13 15:18:36.858 +08:00 BYTED_HOST_IP= [Info ] 2025-05-13 15:18:36.858 +08:00 BYTED_HOST_IPV6= [Info ] 2025-05-13 15:18:36.858 +08:00 REGION= [Info ] 2025-05-13 15:18:36.858 +08:00 ==check-remote-system.sh=finish== [Info ] 2025-05-13 15:18:36.858 +08:00 [Info ] 2025-05-13 15:18:36.858 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702][SSH:ExecPartial] stdout: OS_VERSION_ID=22.04 [Info ] 2025-05-13 15:18:36.858 +08:00 OS_ID=ubuntu [Info ] 2025-05-13 15:18:36.858 +08:00 GLIBC_VERSION=2.35 [Info ] 2025-05-13 15:18:36.858 +08:00 GLIBCXX_VERSION=3.4.30 [Info ] 2025-05-13 15:18:36.858 +08:00 RUNTIME_IDC_NAME= [Info ] 2025-05-13 15:18:36.858 +08:00 CONSUL_DATACENTER= [Info ] 2025-05-13 15:18:36.858 +08:00 BYTED_HOST_IP= [Info ] 2025-05-13 15:18:36.858 +08:00 BYTED_HOST_IPV6= [Info ] 2025-05-13 15:18:36.858 +08:00 REGION= [Info ] 2025-05-13 15:18:36.858 +08:00 ==check-remote-system.sh=finish== [Info ] 2025-05-13 15:18:36.858 +08:00 [Error] 2025-05-13 15:18:36.859 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702]操作系统不支持:environment: 行 203: curl: 未找到命令 [Error] 2025-05-13 15:18:36.859 +08:00 environment: 行 204: curl: 未找到命令 [Error] 2025-05-13 15:18:36.859 +08:00 [Error] 2025-05-13 15:18:36.859 +08:00 [node][53c921f5-bbfc-4f2f-8ac1-7ea3dda56ef2][1747120683836_270702]Error resolving authority [Error: preCheckSystem error: Error: 操作系统不支持:environment: 行 203: curl: 未找到命令 environment: 行 204: curl: 未找到命令 at t.preCheckSystem (d:\TRAE\Trae CN\resources\app\extensions\icube-remote-ssh\out\extension.js:2:730472) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async d:\TRAE\Trae CN\resources\app\extensions\icube-remote-ssh\out\extension.js:2:447446 at async n.step (d:\TRAE\Trae CN\resources\app\extensions\icube-remote-ssh\out\extension.js:2:696005) at async d:\TRAE\Trae CN\resources\app\extensions\icube-remote-ssh\out\extension.js:2:447295] { [stack]: [Getter/Setter], [message]: 'preCheckSystem error: Error: 操作系统不支持:environment: 行 203: curl: 未找到命令\n' + 'environment: 行 204: curl: 未找到命令\n' }
最新发布
05-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值