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:
-
Open your terminal.
-
Check current
LS_COLORS:
You can view the current color settings by running:echo $LS_COLORS -
Modify
LS_COLORS:
You can set theLS_COLORSvariable in your shell configuration file (like.bashrc,.bash_profile, or.zshrcdepending on your shell). Add or modify the following line:export LS_COLORS='ln=cyan' # Change 'cyan' to your preferred colorHere,
lnstands for symbolic links. You can replacecyanwith any other color name or code. -
Apply changes:
After editing the configuration file, apply the changes by running:source ~/.bashrc # or ~/.bash_profile or ~/.zshrc -
Verify changes:
Use thels -lcommand 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=36sets symlinks to cyan.
Feel free to customize the colors as per your preference!
