![]() ![]() This can be set manually too with/out using dircolors (see Vivid below). If LS_COLORS isn't set, it's generated using dircolors behind the scenes. LS_COLORS is the variable that's referred by ls for colouring its output. To get the change to take the effect (without restarting the shell), type: source ~/.bashrc Alternatively you can do it with sed program and its substitution feature ( 's/PATTERN/NEW_STRING/' syntax) from the command line directly: sed -i 's/ 42/ 01/' ~/.dircolorsĪbove 2 things can be achieved by a single command using a pipe ' |': dircolors -p | sed 's/ 42/ 01/' > ~/.dircolors Now open the file in an editor and find the following line: OTHER_WRITABLE 34 42 # dir that is other-writable (o+w) and not stickyĬhange the number 42 (denoting green background) to 01 (no background) and save changes. In the command line type the following: dircolors -p > ~/.dircolorsĭircolor -p prints the current config and > redirects the output to the given file. To remove green background for o+w ('writable by others' permission marked by last ' w' in drwxrwxrwx notation in ls) directories you need to create this file basing on the current (built-in) config. Test -r ~/.dircolors & eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"īecause by default the file ~/.dircolors does not actually exist the script uses the built-in Bash config ( eval "$(dircolors -b)"). The default ~/.bashrc script loads the config with these lines: # enable color support of ls and also add handy aliases There is a program dircolors intended to set up the config for ls. Enter these two commands in the Bash command line: dircolors -p | sed 's/ 42/ 01/' > ~/.dircolors ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |