colour_prompt_and_ls_output_with_debian
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
colour_prompt_and_ls_output_with_debian [2013/01/23 05:58] – 206.174.106.118 | colour_prompt_and_ls_output_with_debian [2013/01/27 00:38] (current) – lonney | ||
---|---|---|---|
Line 3: | Line 3: | ||
With the CentOS based IRLP software the output from the ls command was colourised. With Debian this is disabled by default, but is quite simple to enable. | With the CentOS based IRLP software the output from the ls command was colourised. With Debian this is disabled by default, but is quite simple to enable. | ||
- | - Change to your home directory: '' | + | Borrowed from http://jbsteiner.com/ |
- | - Edit '' | + | |
- | | + | |
- | | + | |
- | | + | |
- | This will enable | + | - As root backup ''/ |
+ | - As root edit ''/ | ||
+ | |||
+ | < | ||
+ | |||
+ | # System-wide .bashrc file for interactive bash(1) shells. | ||
+ | |||
+ | # To enable | ||
+ | # this file has to be sourced in / | ||
+ | |||
+ | # If not running interactively, | ||
+ | [ -z " | ||
+ | |||
+ | # check the window size after each command and, if necessary, | ||
+ | # update the values of LINES and COLUMNS. | ||
+ | shopt -s checkwinsize | ||
+ | |||
+ | # set variable identifying the chroot | ||
+ | if [ -z " | ||
+ | debian_chroot=$(cat / | ||
+ | fi | ||
+ | |||
+ | use_color=false | ||
+ | |||
+ | # Set colorful PS1 only on colorful terminals. | ||
+ | # dircolors --print-database uses its own built-in database | ||
+ | # instead of using / | ||
+ | # first to take advantage of user additions. | ||
+ | # globbing instead of external grep binary. | ||
+ | safe_term=${TERM// | ||
+ | match_lhs="" | ||
+ | [[ -f ~/ | ||
+ | [[ -f / | ||
+ | [[ -z ${match_lhs} | ||
+ | && type -P dircolors >/ | ||
+ | && match_lhs=$(dircolors --print-database) | ||
+ | [[ $' | ||
+ | |||
+ | if ${use_color} ; then | ||
+ | # Enable colors for ls, etc. Prefer ~/ | ||
+ | if type -P dircolors >/ | ||
+ | if [[ -f ~/ | ||
+ | eval $(dircolors -b ~/ | ||
+ | elif [[ -f / | ||
+ | eval $(dircolors -b / | ||
+ | fi | ||
+ | fi | ||
+ | |||
+ | if [[ ${EUID} == 0 ]] ; then | ||
+ | PS1=' | ||
+ | | ||
+ | PS1=' | ||
+ | fi | ||
+ | |||
+ | alias ls='ls --color=auto' | ||
+ | alias grep=' | ||
+ | else | ||
+ | if [[ ${EUID} == 0 ]] ; then | ||
+ | # show root@ when we don't have colors | ||
+ | PS1=' | ||
+ | else | ||
+ | PS1=' | ||
+ | fi | ||
+ | fi | ||
+ | |||
+ | # Try to keep environment pollution down, EPA loves us. | ||
+ | unset use_color safe_term match_lhs | ||
+ | |||
+ | # Commented out, don't overwrite xterm -T " | ||
+ | # If this is an xterm set the title to user@host: | ||
+ | #case " | ||
+ | # | ||
+ | # PROMPT_COMMAND=' | ||
+ | # ;; | ||
+ | #*) | ||
+ | # ;; | ||
+ | #esac | ||
+ | |||
+ | # enable | ||
+ | if [ -f / | ||
+ | . / | ||
+ | fi | ||
+ | |||
+ | # if the command-not-found package is installed, use it | ||
+ | if [ -x / | ||
+ | function command_not_found_handle { | ||
+ | # check because c-n-f could' | ||
+ | if [ -x / | ||
+ | / | ||
+ | | ||
+ | elif [ -x / | ||
+ | / | ||
+ | | ||
+ | else | ||
+ | | ||
+ | fi | ||
+ | } | ||
+ | fi | ||
+ | |||
+ | </ | ||
+ | |||
+ | Logout and login again, the prompt and ls output will now be coloured. |
colour_prompt_and_ls_output_with_debian.1358920732.txt.gz · Last modified: 2013/01/23 05:58 by 206.174.106.118