mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-15 21:48:56 +00:00
Update cheatsheets
This commit is contained in:
25
linux/hostnamectl
Normal file
25
linux/hostnamectl
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# hostnamectl
|
||||
|
||||
> Get or set the hostname of the computer.
|
||||
> More information: <https://manned.org/hostnamectl>.
|
||||
|
||||
- Get the hostname of the computer:
|
||||
|
||||
`hostnamectl`
|
||||
|
||||
- Set the hostname of the computer:
|
||||
|
||||
`sudo hostnamectl set-hostname "{{hostname}}"`
|
||||
|
||||
- Set a pretty hostname for the computer:
|
||||
|
||||
`sudo hostnamectl set-hostname --static "{{hostname.example.com}}" && sudo hostnamectl set-hostname --pretty "{{hostname}}"`
|
||||
|
||||
- Reset hostname to its default value:
|
||||
|
||||
`sudo hostnamectl set-hostname --pretty ""`
|
||||
Reference in New Issue
Block a user