How to apply changes?

To apply changes made to your .bashrc file (or any shell configuration file), you need to refresh the current shell session so that it recognizes the new settings. Here are the steps to do that:

Applying Changes to .bashrc

  1. Source the .bashrc File: The most common way to apply changes is to use the source command. This command executes the contents of the .bashrc file in the current shell session.

    source ~/.bashrc

    Alternatively, you can use the shorthand:

    . ~/.bashrc
  2. Open a New Terminal Session: Another way to apply the changes is to simply close the current terminal window and open a new one. This will automatically load the updated .bashrc file.

  3. Verify the Changes: After applying the changes, you can verify that they have taken effect. For example, if you modified the command prompt, you should see the new prompt style. If you set environment variables, you can check them using:

    echo $VARIABLE_NAME

    Or, if you created aliases, you can test them directly in the terminal.

Summary

  • Use source ~/.bashrc or . ~/.bashrc to apply changes immediately.
  • Alternatively, open a new terminal session to load the updated configuration.
  • Verify that the changes have taken effect by checking the prompt or environment variables.

If you have any further questions or need additional assistance, feel free to ask!

0 Comments

no data
Be the first to share your comment!