Debian character terminal settings-Linux Release Technology-Debian information. The following is a detailed description. Source: http://hi.baidu.com/busybox
After the basic system of Debian is installed, the host name and pure black/white interface are displayed after entering the terminal. Now let's set up the character terminal environment to make it black and green, and the files and folders are displayed in different colors.
1. first introduce the color code, effect code, and escape characters of the character terminal, as shown in the following table:
Foreground background color
----------------------------------------
30 40 black
31 41 red
32 42 green
33 43? Color
34 44 blue
35 45 purple red
36 46 blue
37 47 white
Code meaning
-------------------------------------
\ A (\ 007) ASCII Bell character
\ E (\ 033) ASCII Escape Character
\ D indicates the date, in the format of weekday month date, for example: "Mon Aug 1"
\ H complete host name. For example, if my machine name is fc4.linux, this name is fc4.linux.
\ H only takes the first name of the host. In the preceding example, It is fc4, And. linux is omitted.
\ J number of processes suspended by pressing ^ Z in this shell
\ L terminal device name
\ T display time is in the 24-hour format, for example: HH: MM: SS
\ T display time is 12 hours
\ A display time: HH: MM
\ R carriage return
\ N linefeed
\ S shell Name
\ U account name of the current user
\ V bash version information
\ V bash version (including patch level)
\ W complete working directory name. In the home directory ~ Replace
\ W uses basename to get the working directory name, so only the last directory is listed.
\ # Command number (as long as you type the content, it will accumulate at each prompt)
\ $ Prompt character. If it is root, the prompt is: #, and the normal user is: $
\! Location of the current command in the History buffer zone
\ N create a row
\ [Appear before the Character Sequence without moving the cursor
\] Appears after non-printable characters
\ Backslash
\ Xxx inserts an ASCII character in the format of "three-digit xxx" (replace unused digits with zero, for example, "\ 007 ").
2. Modify ~ /. Bashrc file. The command is as follows:
Vi ~ /. Bashrc
Modify PS1 as follows:
Export PS1 = '\ [\ 033 [1; 32; 40m \] \ u @ \ h: \ w \ $ \ [\ 033 [0m \]'
In the preceding command, "\ 033 [0; 32; 40 m" indicates the color of the subsequent text, "\ 033" indicates that an escape sequence is started, and "[" indicates that the color definition starts, "1" defines the font as highlighted; "32" indicates that the foreground color of the text is green; "40" defines that the background color of the text is black.
"\ U" shows the current user name, "\ h" shows the host name, and "\ w" shows the complete working directory name.
"\ 033 [0m" is defined at the end of the string, which is used to restore the default text color settings, so that only one color prompt is obtained, it does not affect the command and the color display of its output (that is, black and white ).
3. Set the file and folder to display different colors.
Also changed ~ /. Bashrc file. The command is as follows:
Vi ~ /. Bashrc
Modify as follows:
# Export LS_OPTIONS = '-- color = auto'
# Eval 'dircolor'
# Alias ls = 'ls $ LS_OPTIONS'
# Alias ll = 'ls $ LS_OPTIONS-l'
# Alias l = 'ls $ LS_OPTIONS-la'
Remove "#" as follows:
Export LS_OPTIONS = '-- color = auto'
Eval 'dircolor'
Alias ls = 'ls $ LS_OPTIONS'
Alias ll = 'ls $ LS_OPTIONS-l'
Alias l = 'ls $ LS_OPTIONS-la'
In this way, the character terminal is configured.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service