Determine OS from a single command line operation

后端 未结 3 1971
粉色の甜心
粉色の甜心 2021-01-28 05:59

Introduction:

I have a \'magic\' tool that can perform a command line operation on a machine if I provide the IP. The tool knows the OS that machine is

3条回答
  •  渐次进展
    2021-01-28 06:37

    Safest way to determine Linux/version is

    cat /etc/*release
    

    Sample output.

    DISTRIB_ID=LinuxMint
    DISTRIB_RELEASE=17
    DISTRIB_CODENAME=qiana
    DISTRIB_DESCRIPTION="Linux Mint 17 Qiana"
    NAME="Ubuntu"
    VERSION="14.04.1 LTS, Trusty Tahr"
    ID=ubuntu
    ID_LIKE=debian
    PRETTY_NAME="Ubuntu 14.04.1 LTS"
    VERSION_ID="14.04"
    HOME_URL="http://www.ubuntu.com/"
    SUPPORT_URL="http://help.ubuntu.com/"
    BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
    

提交回复
热议问题