How to make aliases permanent?

0122

To make aliases permanent, you need to add them to your shell's configuration file. Here’s how you can do it for different shells:

For Bash

  1. Open your terminal.
  2. Edit the .bashrc file in your home directory:
    nano ~/.bashrc
  3. Add your alias at the end of the file. For example:
    alias ll='ls -la'
  4. Save the file and exit the editor (in nano, you can do this by pressing CTRL + X, then Y, and Enter).
  5. To apply the changes, run:
    source ~/.bashrc

For Zsh

  1. Open your terminal.
  2. Edit the .zshrc file in your home directory:
    nano ~/.zshrc
  3. Add your alias at the end of the file. For example:
    alias ll='ls -la'
  4. Save the file and exit the editor.
  5. To apply the changes, run:
    source ~/.zshrc

After following these steps, your aliases will be available in every new terminal session.

0 Comments

no data
Be the first to share your comment!