Would someone be able to explain to me what this line does.

I understand that eval creates a command by concatenating arguments. I also understand that the the text will execute because they are inside of backticks.

I am trying to get the solarized colors in my Ubuntu 13.10 gnome-terminal. I know how to do it but I really want to understand what is going on.

I am getting the colors from this git repository

share|improve this question
up vote 2 down vote accepted

It is simple. dircolors set colour for ls. In the above mentioned link there are few predefined colour scheme for ls.

when you run the following command in terminal

eval `dircolors /path/to/dircolorsdb`

The stored database is loaded and ls output colors changes accordingly. If you close the existing terminal it will not be available anymore. To make the change permanent.

  • Create a file ~/.dir_colors
  • Copy the color database file (that you want to apply) in it.
  • Add the following command at the end of ~/.bashrc.
eval `dircolors ~/.dir_colors`
  • Source ~/.bashrc using the command in terminal
source ~/.bashrc

It will activate the theme for all future shell sessions.

Note: There are some additional instructions for 256-color Solarized Themes. Go through the Readme before you go for it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.