output_redirection : remove NOTE tag.
This commit is contained in:
parent
8ee5fca358
commit
e0046f903a
30
help/linux/bash/basic/color.md
Normal file
30
help/linux/bash/basic/color.md
Normal file
|
@ -0,0 +1,30 @@
|
|||
# Bash colors.
|
||||
|
||||
## How to use.
|
||||
Most of the time you want to use it with `echo`. To make `echo` respect colors, you need to use `-e` flag like that:
|
||||
```bash
|
||||
export color_default="\033[0m"
|
||||
export color_red="\033[0;31m"
|
||||
echo -e "${color_red}hello world!${color_default}" # will print "hello world!" in red.
|
||||
```
|
||||
|
||||
## List of colors.
|
||||
Please note that colors depend on Terminal Emulator and may vary based on its settings.
|
||||
|
||||
|Color|Code|
|
||||
|---|---|
|
||||
|default|`\033[0m`|
|
||||
|blue|`\033[0;34m`|
|
||||
|blue (bold)|`\033[1;34m`|
|
||||
|cyan|`\033[0;36m`|
|
||||
|cyan (bold)|`\033[1;36m`|
|
||||
|green|`\033[0;32m`|
|
||||
|green (bold)|`\033[1;32m`|
|
||||
|purple|`\033[0;35m`|
|
||||
|purple (bold)|`\033[1;35m`|
|
||||
|red|`\033[0;31m`|
|
||||
|red (bold)|`\033[1;31m`|
|
||||
|white|`\033[0;37m`|
|
||||
|white (bold)|`\033[1;37m`|
|
||||
|yellow|`\033[0;33m`|
|
||||
|yellow (bold)|`\033[1;33m`|
|
|
@ -8,7 +8,7 @@ echo "hello" | base64
|
|||
## file.
|
||||
```bash
|
||||
echo "hello" > file.txt # write "hello" to file.txt.
|
||||
less < file.txt # read from file.txt and send to less. NOTE: program must support reading from stdin.
|
||||
less < file.txt # read from file.txt and send to less. program must support reading from stdin.
|
||||
```
|
||||
|
||||
## output as argument.
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
TODO: add info about colors.
|
Loading…
Reference in a new issue