System Information
Retrieving and displaying information about the Linux system
hostnamectl
The hostnamectl
utility is part of systemd, and it is used to query and change the system hostname. It also displays the Linux distribution and kernel version:
If hostnamectl
is executed by itself, without any additional commands / options, it will output the same information as the command hostnamectl status
Sample output:
Static hostname: example
Icon name: computer-laptop
Chassis: laptop
Machine ID: af8ce1d394b844fea8c19ea5c6a9bd09
Boot ID: 15bc3ae7bde842f29c8d925044f232b9
Operating System: Ubuntu 18.04.2 LTS
Kernel: Linux 4.15.0-54-generic
Architecture: x86-64
uname
The uname
command displays several system information including, the Linux kernel, processor architecture, name version, and release.
Syntax
uname [OPTIONS]...
The options are as follows:
-s
, (--kernel-name
) - Prints the kernel name.-n
, (--nodename
) - Prints the system’s node name (hostname).-r
, (--kernel-release
) - Prints the kernel release.-v
, (--kernel-version
) - Prints the kernel version.-m
, (--machine
) - Prints the name of the machine’s hardware name.-p
, (--processor
) - Prints the architecture of the processor.-i
, (--hardware-platform
) - Prints the hardware platform.-o
, (--operating-system
) - Print the name of the operating system.-a
, (--all
) - Prints all information, except omit-p
and-i
if unknown.
Sample output:
Linux 4.19.0-9-amd64 x86_64
uptime
uptime
gives a one line display of the following information. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.
Sample output
03:35:55 up 2:46, 1 user, load average: 0.79, 0.62, 0.74
/proc/ folder
The /proc
directory contains virtual files with information about the system memory , CPU cores , mounted filesystems , processes, and more.
The numbered directories in /proc
correspond to process ids running on the system. The status
file in these folders contains detailed information about the process
Use commands cat
or less
to display contents of these files.
File in /proc/
Contents
/proc/cmdline
shows the parameters passed to the kernel at the time it is started
/proc/cpuinfo
processor information, per core
/proc/meminfo
memory information
/proc/version
kernel information
Sample output:
Linux version 4.15.0-54-generic (buildd@lgw01-amd64-014) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019
Last updated