Tag Info

New answers tagged

0

This does only the two-color highlight for path and filename, not the per-filetype thing of ls: Configure the colors of grep output in the right way for matched and unmatched part, and match the filename: $ export GREP_COLORS="sl=0;33;49:ms=1;34;49" $ find /etc/ -type f | head | grep --color=always '^\|[^/]*$' You may not want to overwrite the ...


0

For what it's worth, I just installed Xfce on an Ubuntu 14.04 system (been meaning to do that - I hate Unity3D Desktop), and it looks just fine. So it appears you have a problem most likely with your hardware, and I recommend you contact the BeagleBone Black support folks.


25

There are several aspects at play in what you're asking. First, bash doesn't define colors. In fact bash has absolutely no idea that colors even exist. All it knows is that you told it to output the characters \033[0;36m. Your terminal emulator (xterm, gnome-terminal, whatever) receives these characters and understands "I need to start outputting in cyan". ...


7

If you want something like that, just add the lines to your ~/.profile: GRAY="\[\033[1;30m\]" LIGHT_GRAY="\[\033[0;37m\]" CYAN="\[\033[0;36m\]" LIGHT_CYAN="\[\033[1;36m\]" NO_COLOUR="\[\033[0m\]" Or, to have them only on demand, add them to a file in your $HOME and source it in your scripts: . ~/.mycolors To make them available globally, add to ...


6

grep --colour=always $search $file This should work if these are the names of your variables, hope it helps!!


2

In an escape sequence like ^[[31m, the escape character ^[ is non-printing, but the other characters [31m are printing characters. So sort -i won't help you: it ignores the escape characters but still sorts [31mred[0m before [32mgreen[0m. A generic way to sort data according to criteria that go beyond the built-in abilities of the sort utility is to double ...


0

Something like ␛[01;38;05;129m, where the first character ␛ is the ASCII escape character (U+0027), is a terminal escape sequence. It instructs the terminal to start displaying bold, blinking text in color 129. \e is bash syntax for the escape character (inside $'…', in PS1, in echo -e and in printf). \[ and \] are not terminal escape sequences, they're ...


3

-k option of sort takes two numerical arguments: field and character. You want to sort on 6th character of first field. It is 6th character because %F{green} is replaced by ESC[32m. So this should work: print -lP "%F{green}"${^$(setopt)} "%F{red}"${^$(unsetopt)} | sort -k 1.6


2

The "non-printing escape sequence" is needed when using non-printing characters in $PS1 because bash needs to know the position of the cursor so that the screen can be updated correctly when you edit the command line. Bash does that by counting the number of bytes in the $PS1 prompt and then that's the column number the cursor is in. However, if you place ...


0

The problem was that the version of zsh was 4.3.6. According to the release notes, the %F color expansion feature of the prompt was not added until 5.0 (though the release notes aren't 100% clear here-- in any case, %F doesn't show up in the 4.3.6 zshmisc manpage, which contains the prompt expansion documentation). Confusingly, the %F is still removed from ...



Top 50 recent answers are included