πŸ‘₯ Linux/Unix: User, Group & Security Management
Estimated reading: 3 minutes 432 views

Linux/Unix: System Info Commands – uname, hostname, uptime Explained

Introduction – Why Learn Linux System Information Commands?

As a Linux user or system administrator, you often need to check system details, such as the OS version, hostname, kernel, or how long the system has been running. Simple tools like uname, hostname, and uptime provide quick insights into system identity, stability, and uptimeβ€”especially helpful during audits, maintenance, and troubleshooting.

In this guide, you’ll learn:

  • How to view OS and kernel details using uname
  • How to manage system hostnames with hostname
  • How to check system availability and load averages using uptime

1. uname – Kernel and System Information

What is uname?

uname stands for Unix Name and prints system information such as kernel name, version, and architecture.

Syntax:

uname [options]

Common uname Options:

OptionDescription
-sKernel name
-nNode (hostname)
-rKernel release
-vKernel version
-mMachine hardware name (architecture)
-aAll system info

Example:

uname -a

Output:

Linux myserver 5.15.0-91-generic #101-Ubuntu SMP x86_64 GNU/Linux

Useful to determine if you’re on a 64-bit system or which kernel version is in use.


2. hostname – View or Set System Hostname

What is hostname?

hostname displays or sets the network hostname of the system. The hostname identifies your device on a network.

Syntax:

hostname [new-name]

Examples:

View current hostname:

hostname

Output:

myserver

Set a new hostname (temporary):

sudo hostname devbox

Permanently change hostname (Ubuntu/Debian):

sudo hostnamectl set-hostname devbox

You may also edit /etc/hostname and /etc/hosts manually for full hostname persistence across reboots.


️ 3. uptime – Show System Running Time and Load

What is uptime?

uptime shows how long the system has been running, the number of users, and system load averages for the past 1, 5, and 15 minutes.

Syntax:

uptime

Example:

uptime

Output:

14:12:50 up 5 days, 4:33, 2 users, load average: 0.03, 0.05, 0.01

Interpreting Load Average:

  • 0.00 = no load
  • 1.00 = fully loaded (per core)
  • Use htop or nproc to check how many cores are available

Tool Comparison Table

CommandDescriptionOutput Example
uname -aAll system details (kernel, arch, etc)Linux myserver 5.15… x86_64…
hostnameSystem hostnamemyserver
uptimeSystem running time + loadup 5 days, 2 users, load avg: 0.02

Summary – Recap & Next Steps

These quick system info commands help you check system identity, kernel version, uptime, and load. They’re handy in scripts, server audits, and remote debugging sessions.

Key Takeaways:

  • Use uname -a to see detailed kernel and architecture info.
  • Use hostname to view or set system hostname.
  • Use uptime to quickly check server stability and load.

FAQs

How can I find if my Linux is 32-bit or 64-bit?
Run:

uname -m

Output: x86_64 = 64-bit, i686 = 32-bit

How do I permanently change the hostname in Linux?
Use:

sudo hostnamectl set-hostname newname

What do load averages in uptime mean?
They represent system load over 1, 5, and 15 minutes. Each number should be compared to your core count (use nproc).

Can uptime show past boot times?
Not directly. Use:

who -b

Where is hostname stored in Linux?
Usually in /etc/hostname and /etc/hosts.


Share Now :
Share

πŸ”΅ Linux/Unix: System Info (uname, hostname, uptime)

Or Copy Link

CONTENTS
Scroll to Top