Linux/2-Config/bashrc: Difference between revisions

From Wiki
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== ~/.bashrc ==
== Ubuntu 20.04 ==
* ~/.bashrc
<blockquote>
<pre>
-
</pre>
</blockquote>


* color + root/username
* /root/.bashrc
<blockquote>
<blockquote>
<pre>
<pre>
if [ "$color_prompt" = yes ]; then
force_color_prompt=yes     # uncomment
    if [[ ${EUID} == 0 ]] ; then
 
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[01;34m\] \W \$\[\033[00m\] '              # <- changes
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
    else
 
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w \$\[\033[00m\] '
  # change first "32m" to "31m"
    fi
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '
fi
</pre>
</pre>
</blockquote>
</blockquote>
Line 27: Line 29:
<pre>
<pre>
alias systemctl='systemctl --no-pager'
alias systemctl='systemctl --no-pager'
</pre>
</blockquote>
== /etc/bash.bashrc ==
* autocomplete (uncomment to enable)
<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
</pre>
</pre>
</blockquote>
</blockquote>

Latest revision as of 14:26, 16 October 2020

Ubuntu 20.04

  • ~/.bashrc
-
  • /root/.bashrc
force_color_prompt=yes     # uncomment

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

  # change first "32m" to "31m"

~/.bash_aliases

touch .bash_aliases
  • systemctl without page breaks
alias systemctl='systemctl --no-pager'