Linux/2-Config/bashrc: Difference between revisions

From Wiki
(Die Seite wurde neu angelegt: „== ~/.bashrc == * color + root/username <blockquote> <pre> if [ "$color_prompt" = yes ]; then if [[ ${EUID} == 0 ]] ; then PS1='${debian_chroot:+(…“)
 
No edit summary
Line 12: Line 12:
else
else
     PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '
     PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '
fi
</pre>
</blockquote>
* systemctl without page breaks
<blockquote>
<pre>
alias systemctl='systemctl --no-pager'
</pre>
</blockquote>
== /etc/bash.bashrc ==
* autocomplete (uncomment to activate)
<blockquote>
<pre>
# enable bash completion in interactive shells
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi
fi
</pre>
</pre>
</blockquote>
</blockquote>

Revision as of 13:50, 12 February 2018

~/.bashrc

  • color + root/username
if [ "$color_prompt" = yes ]; then
    if [[ ${EUID} == 0 ]] ; then
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[01;34m\] \W \$\[\033[00m\] '               # <- changes
    else
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w \$\[\033[00m\] '
    fi
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '
fi


  • systemctl without page breaks
alias systemctl='systemctl --no-pager'

/etc/bash.bashrc

  • autocomplete (uncomment to activate)
# enable bash completion in interactive shells
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi