akko Asked: 2020-12-27 18:23:04 +0800 CST 2020-12-27 18:23:04 +0800 CST 2020-12-27 18:23:04 +0800 CST Change colors of the ls command in Linux 772 I would like to change the colors of the ls command on my data partition, since the directories are hard to read from the console. It's an NTFS partition that I share with Windows and my /etc/fstab file contains the following for the partition: /dev/sda4 /media/datos ntfs-3g rw,defaults 0 0 linux 1 Answers Voted Best Answer josego 2020-12-27T18:36:44+08:002020-12-27T18:36:44+08:00 To change the color in the terminal, you must modify your .bashrc file. You enter the terminal: nano $HOME/.bashrc Add at the end of the file: export PS1="\[$(tput setaf 1)\]\u@\h:\w $ \[$(tput sgr0)\]" You save (control + o) and then close (control + x). Now upload your file that you just changed. source ~/.bashrc List of options: tput bold – bold tput rev – invert colors tput sgr0 – Reset all tput setaf {CODE} – Set foreground color, view color {CODE} COLOR CODE: Color {code} Color 0 Black 1 Red 2 Green 3 Yellow 4 Blue 5 Magenta 6 Cyan 7 White Another way to change colors is using LS_COLORS: You enter the terminal: wget https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS -O $HOME/.dircolors echo 'eval $(dircolors -b $HOME/.dircolors)' >> $HOME/.bashrc . $HOME/.bashrc link
To change the color in the terminal, you must modify your .bashrc file.
You enter the terminal:
Add at the end of the file:
You save (control + o) and then close (control + x). Now upload your file that you just changed.
List of options:
COLOR CODE:
Another way to change colors is using LS_COLORS:
You enter the terminal:
link