Command prompt change after reboot

SharonKo

I changed my command prompt using PS1="[\u@\h \W]\$ " but after reboot, it returns to be the default command prompt. How can I make this change to be permanent?

Christian Ternus

Add

PS1="[\u@\h \W]\$ "

to the file .bashrc (assuming your shell is bash) in your home directory.

You can do this with:

echo 'PS1="[\u@\h \W]\$ "'>>~/.bashrc

Minor background: PS1 is an environment variable - a variable that's set for your login session. .bashrc is a file that's read and interpreted by your shell every time it starts up, and you can use it to configure other attributes of the way your shell behaves.

For example, a common way to change your default editor is to add the line

export EDITOR="emacs"

to your .bashrc.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Will 'at' command be executed after the reboot?

From Dev

Prompt a Reboot message after installation WIX Bootstrapper

From Dev

Server boots to grub prompt after reboot

From Dev

Change prompt on command line?

From Dev

chmod after reboot -> Permissions change

From Dev

How to run a command automatically after each reboot

From Dev

How to automatically reboot after running a command

From Dev

Safe to reboot just after running a command?

From Dev

Make route command persistent after reboot

From Dev

Command Prompt change file icon

From Dev

New line after the command prompt

From Dev

Sysctl parameter change after every reboot

From Dev

Change Command Prompt width from the Command Line

From Dev

Change default command prompt in Visual Studio

From Dev

Change directory in Node.js command prompt

From Dev

How to change the git password using command prompt?

From Dev

How to change the default color of the Command Prompt?

From Dev

How to change a Windows username using the command prompt?

From Dev

How do I change the contents of the command prompt?

From Dev

Use command prompt to change date and time

From Dev

ZSH: change prompt just before command is run

From Dev

zsh new line prompt after each command

From Dev

zsh new line prompt after each command

From Dev

Closing connection after executing reboot using ssh command

From Dev

Simplest way to make a command run after system reboot

From Dev

Is there a yum command line switch to be informed whether a reboot is necessary after updating?

From Dev

How to execute a system command one minute after reboot (Linux)?

From Dev

Closing connection after executing reboot using ssh command

From Dev

Why the command in .bash_logout can't run after reboot?

Related Related

  1. 1

    Will 'at' command be executed after the reboot?

  2. 2

    Prompt a Reboot message after installation WIX Bootstrapper

  3. 3

    Server boots to grub prompt after reboot

  4. 4

    Change prompt on command line?

  5. 5

    chmod after reboot -> Permissions change

  6. 6

    How to run a command automatically after each reboot

  7. 7

    How to automatically reboot after running a command

  8. 8

    Safe to reboot just after running a command?

  9. 9

    Make route command persistent after reboot

  10. 10

    Command Prompt change file icon

  11. 11

    New line after the command prompt

  12. 12

    Sysctl parameter change after every reboot

  13. 13

    Change Command Prompt width from the Command Line

  14. 14

    Change default command prompt in Visual Studio

  15. 15

    Change directory in Node.js command prompt

  16. 16

    How to change the git password using command prompt?

  17. 17

    How to change the default color of the Command Prompt?

  18. 18

    How to change a Windows username using the command prompt?

  19. 19

    How do I change the contents of the command prompt?

  20. 20

    Use command prompt to change date and time

  21. 21

    ZSH: change prompt just before command is run

  22. 22

    zsh new line prompt after each command

  23. 23

    zsh new line prompt after each command

  24. 24

    Closing connection after executing reboot using ssh command

  25. 25

    Simplest way to make a command run after system reboot

  26. 26

    Is there a yum command line switch to be informed whether a reboot is necessary after updating?

  27. 27

    How to execute a system command one minute after reboot (Linux)?

  28. 28

    Closing connection after executing reboot using ssh command

  29. 29

    Why the command in .bash_logout can't run after reboot?

HotTag

Archive