hostnamectl - Display System Information

This section provides a tutorial example on how to display operating system information using the 'uname' and other commands on Ubuntu systems.

The first thing you should do on a new Ubuntu computer is to gather its system information as shown in this tutorial. There are multiple commands that you can use:

1. The best command to display system information is the "hostnamectl" command:

herong$ hostnamectl
   Static hostname: ubuntu
         Icon name: computer-laptop
           Chassis: laptop
        Machine ID: ...
           Boot ID: ...
  Operating System: Ubuntu 18.04.6 LTS
            Kernel: Linux 5.4.0-150-generic
      Architecture: x86-64

2. The command "lsb_release" also shows the Linux Standard Base release information:

herong$ lsb_release -a
  No LSB modules are available.
  Distributor ID:	Ubuntu
  Description:	Ubuntu 18.04.6 LTS
  Release:	18.04
  Codename:	bionic

3. The operation system information is also accessible via a special file called /proc/version. You can use the "cat" command to display it:

herong$ cat /proc/version
Linux version 5.4.0-150-generic
  (buildd@bos03-amd64-012) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04))
  #167~18.04.1-Ubuntu SMP Wed May 24 00:51:42 UTC 2023

4. You can also use the original Unix command, uname, to display operating system information:

herong$ uname -mprsv
Linux 5.4.0-150-generic #167~18.04.1-Ubuntu SMP Wed May 24 00:51:42 UTC 2023
  x86_64 x86_64

5. To display only the system architecture, you can use the "arch" from the "coreutils" package included in the Ubuntu distribution:

herong$ arch
x86_64

6. System release files also contain operating system information:

herong$ cat /etc/*elease

  DISTRIB_ID=Ubuntu
  DISTRIB_RELEASE=18.04
  DISTRIB_CODENAME=bionic
  DISTRIB_DESCRIPTION="Ubuntu 18.04.6 LTS"
  NAME="Ubuntu"
  VERSION="18.04.6 LTS (Bionic Beaver)"
  ID=ubuntu
  ID_LIKE=debian
  PRETTY_NAME="Ubuntu 18.04.6 LTS"
  VERSION_ID="18.04"
  HOME_URL="https://www.ubuntu.com/"
  SUPPORT_URL="https://help.ubuntu.com/"
  VERSION_CODENAME=bionic
  UBUNTU_CODENAME=bionic
  ...

Table of Contents

 About This Book

Introduction to Ubuntu Systems

 What is Ubuntu

hostnamectl - Display System Information

 "free" - Display Free and Used Memory

 "who | w" - Logged-in Users and Their Running Commands

 GNOME - Desktop Interface and Environment

 Shell - The Command-Line Interpreter

 Process Management

 Memory Management

 Files and Directories

 APT (Advanced Package Tool)

 Network Connection on Ubuntu

 Internet Networking Tools

 SSH Protocol and ssh/scp Commands

 Administrative Tasks

 References

 Full Version in PDF/EPUB