How to discover what Linux distribution is in use

前端 未结 12 1544
青春惊慌失措
青春惊慌失措 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条回答
  •  渐次进展
    2020-12-02 21:30

    NeoFetch

    ... is a quite professional BASH script that should have all the info you might desire.

    (Disclaimer: I am not affiliated with it)

    Usage

    neofetch --stdout | grep '^OS: ' | sed -e 's/OS:[[:space:]]\+//'
    

    might give:

    Debian GNU/Linux 11 (bullseye) x86_64

    but there is much more info.

    Installation

    Options:

    1. system packaage neofetch

    2. If that is not available, either see the official installation instructions

    3. or for a hacky one-time use - if you have faith and an internet connection - you could use:

      wget 'https://raw.githubusercontent.com/dylanaraps/neofetch/master/neofetch' \
          && bash neofetch --stdout \
          && rm neofetch
      

提交回复
热议问题