How to discover what Linux distribution is in use

前端 未结 12 1549
青春惊慌失措
青春惊慌失措 2020-12-02 20:46

Sometimes I need to access some servers running Linux (or maybe another Unix-like SO), but I don\'t know how to verify which distribution is in use on the server (there are

12条回答
  •  Happy的楠姐
    2020-12-02 21:36

    In my .cshrc I have

    setenv DISTRO `sed -e 's/.*(//' -e 's/)).*//' /proc/version`
    

    For ksh / Bash users, I presume it translates to

    export DISTRO=`sed -e 's/.*(//' -e 's/)).*//' /proc/version`
    

    and of course this may not work for your favorite distribution. (I have had issues with Oracle's Unbreakable Linux giving something similar to Redhat, but it was good enough for my purposes.)

    Update August 2016 I have not used Linux in this way for a while (2008 is a long time ago). It seems that this does not work anymore for the systems I now have.

提交回复
热议问题