How to customize symlink colors?

To customize the colors of symbolic links in your terminal, you can modify the LS_COLORS environment variable. Here’s how you can do it:

  1. Open your terminal.

  2. Check current LS_COLORS:
    You can view the current color settings by running:

    echo $LS_COLORS
  3. Modify LS_COLORS:
    You can set the LS_COLORS variable in your shell configuration file (like .bashrc, .bash_profile, or .zshrc depending on your shell). Add or modify the following line:

    export LS_COLORS='ln=cyan'  # Change 'cyan' to your preferred color

    Here, ln stands for symbolic links. You can replace cyan with any other color name or code.

  4. Apply changes:
    After editing the configuration file, apply the changes by running:

    source ~/.bashrc  # or ~/.bash_profile or ~/.zshrc
  5. Verify changes:
    Use the ls -l command to check if the symlink color has changed.

Example of LS_COLORS settings:

You can set multiple file types with different colors. Here’s an example:

export LS_COLORS='no=0:fi=0:di=34:ln=36:pi=33:so=32:bd=46;34:cd=46;34:or=31;43'

In this example:

  • ln=36 sets symlinks to cyan.

Feel free to customize the colors as per your preference!

0 Comments

no data
Be the first to share your comment!