How to get Linux distribution name and version?

后端 未结 8 1859
轻奢々
轻奢々 2021-02-04 06:28

In Windows I read the registry key SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProductName to get the full name and version of the OS.

But in Linux, th

8条回答
  •  误落风尘
    2021-02-04 07:12

    1. cat release file to display Linux distro version

      $ cat /etc/*-release
      
    2. lsb_release will return Linux distribution name and version

      $ lsb_release -a 
      
    3. hostnamectl will return Linux distribution name and version

      $ hostnamectl
      
    4. To print certain system information

      $ uname -a
      or 
        -s, --kernel-name        print the kernel name
        -n, --nodename           print the network node hostname
        -r, --kernel-release     print the kernel release
        -v, --kernel-version     print the kernel version
        -m, --machine            print the machine hardware name
        -p, --processor          print the processor type (non-portable)
        -i, --hardware-platform  print the hardware platform (non-portable)
        -o, --operating-system   print the operating system
      
    5. To find out Static hostname, Chassis, Mchine ID, Virtualization, OS, Kernel, Architecture

      $ cat /proc/version
      

提交回复
热议问题