Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Archives for hostname

January 20, 2020

Linux Prompt

Here’s my favorite Linux prompt.

PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

Add to end of your .bashrc to make it permanent.

January 14, 2019

Hostname

If you need to change your system’s hostname, use hostname or hostnamectl commands.

hostname servername
hostnamectl set-hostname servername

hostname servername hostnamectl set-hostname servername

You can add the hostname to these 2 files and reboot.

vi /etc/hostname
vi /etc/hosts
reboot

vi /etc/hostname vi /etc/hosts reboot

Without a reboot. Add the hostname to these 2 files.

vi /etc/hostname
vi /etc/hosts

vi /etc/hostname vi /etc/hosts

And add a hostname entry to 127.0.0.1 in /etc/hosts.

127.0.0.1 servername

127.0.0.1 servername

That’s all she wrote.

  • Cloud
  • Linux
  • Git

Copyright © 2012–2021