Chapter 5. Networking Commands
Host Information
|
Print basic system information. |
|
Print the system’s hostname. |
|
Set and display network interface information. |
Every Linux machine or host has a name, a network IP address, and other properties. Here’s how to display this information.
uname |
stdin |
stdout |
- file |
-- opt |
--help |
--version |
uname [options] |
The uname
command prints fundamental information about the OS, particularly the kernel:
→ uname -a Linux myhost 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
This includes the kernel name (Linux), hostname (myhost), kernel release (5.15.0-76-generic), kernel version (#83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023), hardware name (x86_64), processor type (also x86_64), hardware platform (also x86_64) and OS name (GNU/Linux).
Useful options
|
All information |
|
Only the kernel name (the default) |
|
Only the hostname, as with the |
|
Only the kernel release |
|
Only the kernel version |
|
Only the hardware name |
|
Only the processor type |
|
Only the hardware platform |
|
Only the OS name |
hostname |
stdin |
stdout |
- file |
-- opt |
--help |
--version |
hostname [options] [name] |
The hostname
command prints the name of your computer. Depending on
how you have things set up, this might be the fully qualified
hostname:
→ hostname myhost.example.com
or your short hostname:
→ hostname myhost
You can also set your hostname, as root: ...
Get Linux Pocket Guide, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.