大约有 114 项符合查询结果(耗时:0.0105秒) [XML]
How to change the output color of echo in Linux
...# .---------- constant part!
# vvvv vvvv-- the code from above
RED='\033[0;31m'
NC='\033[0m' # No Color
printf "I ${RED}love${NC} Stack Overflow\n"
which prints love in red.
From @james-lim's comment, if you are using the echo command, be sure to use the -e flag to allow backslash escapes.
...
How to print color in console using System.out.println?
...lass ConsoleColors {
// Reset
public static final String RESET = "\033[0m"; // Text Reset
// Regular Colors
public static final String BLACK = "\033[0;30m"; // BLACK
public static final String RED = "\033[0;31m"; // RED
public static final String GREEN = "\033[0;32m";...
List of ANSI color escape sequences
On most terminals it is possible to colorize output using the \033 ANSI escape sequence.
5 Answers
...
Colorizing text in the console with C++
...nt argc, char ** argv){
printf("\n");
printf("\x1B[31mTexting\033[0m\t\t");
printf("\x1B[32mTexting\033[0m\t\t");
printf("\x1B[33mTexting\033[0m\t\t");
printf("\x1B[34mTexting\033[0m\t\t");
printf("\x1B[35mTexting\033[0m\n");
printf("\x1B[36mTexting\033[0m\t\t")...
Colorized Ruby output to the terminal [closed]
....
//foreground color
public static final String BLACK_TEXT() { return "\033[30m";}
public static final String RED_TEXT() { return "\033[31m";}
public static final String GREEN_TEXT() { return "\033[32m";}
public static final String BROWN_TEXT() { return "\033[33m";}
public static final St...
Adding git branch on the Bash command prompt
...ashrc):
PS1='\[\e]0;\u@\h: \w\a\]\n${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1)\$ '
Everything is a different color, including the branch.
In in Linux Mint 17.3 Cinnamon 64-bit:
PS1='${debian_chroot:+($debian_chroot)...
How do I print bold text in Python?
...
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
print(color.BOLD + ...
How do I output coloured text to a Linux terminal?
...quences are not supported, garbage will show up.
Example:
cout << "\033[1;31mbold red text\033[0m\n";
Here, \033 is the ESC character, ASCII 27. It is followed by [, then zero or more numbers separated by ;, and finally the letter m. The numbers describe the colour and format to switch to fr...
How do I list the functions defined in my shell?
...iases and functions:
function functionaliaslist() {
echo
echo -e "\033[1;4;32m""Functions:""\033[0;34m"
declare -F | awk {'print $3'}
echo
echo -e "\033[1;4;32m""Aliases:""\033[0;34m"
alias | awk {'print $2'} | awk -F= {'print $1'}
echo
echo -e "\033[0m"
}
That was b...
What is the difference between PS1 and PROMPT_COMMAND
...ob described) and then echo the string that I intend to be PS1:
GREEN="\[\033[0;32m\]"
CYAN="\[\033[0;36m\]"
RED="\[\033[0;31m\]"
PURPLE="\[\033[0;35m\]"
BROWN="\[\033[0;33m\]"
LIGHT_GRAY="\[\033[0;37m\]"
LIGHT_BLUE="\[\033[1;34m\]"
LIGHT_GREEN="\[\033[1;32m\]"
LIGHT_CYAN="\[\033[1;36m\]"
LIGHT_RED...