How to make changes permanent?

0141

To make changes to your terminal prompt permanent, you need to add the customization to your shell's configuration file. Here’s how to do it for common shells:

For Bash Shell:

  1. Open the .bashrc file in your home directory:

    nano ~/.bashrc
    
  2. Add or modify the PS1 variable with your desired prompt customization. For example:

    export PS1="\u@\h:\w\$ "
    
  3. Save the file and exit the editor.

  4. Apply the changes by running:

    source ~/.bashrc
    

For Zsh Shell:

  1. Open the .zshrc file in your home directory:

    nano ~/.zshrc
    
  2. Add or modify the PROMPT variable with your desired prompt customization. For example:

    export PROMPT="%n@%m:%~%# "
    
  3. Save the file and exit the editor.

  4. Apply the changes by running:

    source ~/.zshrc
    

For Other Shells:

If you are using a different shell, look for its specific configuration file (like .kshrc for Korn shell or .cshrc for C shell) and follow a similar process.

By adding your prompt customization to these configuration files, the changes will persist across terminal sessions.

0 Comments

no data
Be the first to share your comment!