0
0
Linux CLIscripting~5 mins

Linux distributions overview (Ubuntu, CentOS, Fedora) in Linux CLI - Commands & Configuration

Choose your learning style9 modes available
Introduction
Linux distributions are different versions of the Linux operating system. Each distribution has its own features and tools. Ubuntu, CentOS, and Fedora are popular choices that serve different needs for users and servers.
When you want a user-friendly desktop experience with lots of software support, choose Ubuntu.
When you need a stable and secure server environment for business, CentOS is a good choice.
When you want the latest Linux features and software for testing or development, Fedora is suitable.
Commands
This command shows detailed information about the Linux distribution you are using. It helps you identify if you are on Ubuntu, CentOS, Fedora, or another distro.
Terminal
lsb_release -a
Expected OutputExpected
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.2 LTS Release: 22.04 Codename: jammy
-a - Show all available distribution information
This command shows the CentOS version if you are using CentOS. It reads the release file specific to CentOS.
Terminal
cat /etc/centos-release
Expected OutputExpected
CentOS Linux release 7.9.2009 (Core)
This command shows the Fedora version if you are using Fedora. It reads the release file specific to Fedora.
Terminal
cat /etc/fedora-release
Expected OutputExpected
Fedora release 38 (Thirty Eight)
Key Concept

If you remember nothing else, remember: each Linux distribution has its own way to show its version and purpose, so use the right command to check which one you have.

Common Mistakes
Trying to use 'cat /etc/centos-release' on Ubuntu or Fedora systems.
The file does not exist on those systems, so the command fails.
Use 'lsb_release -a' for Ubuntu or 'cat /etc/fedora-release' for Fedora to check the version.
Assuming all Linux distributions use the same package manager.
Ubuntu uses apt, CentOS uses yum or dnf, Fedora uses dnf, so commands differ.
Learn the package manager for your distribution before installing software.
Summary
Use 'lsb_release -a' to find detailed info on Ubuntu and many other distros.
Use 'cat /etc/centos-release' to check CentOS version.
Use 'cat /etc/fedora-release' to check Fedora version.