Cambiar el nombre de host y el mensaje en la terminal OS X

Cambiar el nombre de host y el mensaje en la terminal OS X

On a Mac the hostname and prompt is:

workstation:~ thomas$

On Ubuntu Linux it would be:

thomas@workstation:~$ 

How can I make the OS X prompt look like the Ubuntu one?

Respuesta1

Just run this command in terminal

PS1="[\u@\h:\w]$ "

here

  • u represents username
  • h represents hostname
  • w represents current working directory

This is temporary, that means after running this command if you close the terminal again, the default prompt will appear.

Si desea configurarlo de forma permanente, inserte la siguiente línea en su .bash_profilearchivo en su directorio de inicio:

export PS1="[\u@\h:\w]$ "

información relacionada