snipt

Ctrl+h for KB shortcuts

Bash

Change Linux hostname without reboot

1
2
3
vim /etc/hostname
vim /etc/hosts
hostname new-hostname
https://snipt.net/embed/88ab7887b6637d9446fd791c21d5e134/
/raw/88ab7887b6637d9446fd791c21d5e134/
88ab7887b6637d9446fd791c21d5e134
bash
Bash
3
2019-08-25T18:47:46
True
False
False
/api/public/snipt/6407/
change-linux-hostname-without-reboot
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>vim /etc/hostname </span><span id="L-2"><a name="L-2"></a>vim /etc/hosts </span><span id="L-3"><a name="L-3"></a>hostname new-hostname </span></pre></div> </td></tr></table>
admin, bash, linux