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
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
== ~/.bashrc ==
== Ubuntu 20.04 ==
* ~/.bashrc
<blockquote>
<pre>
-
</pre>
</blockquote>
 
* /root/.bashrc
<blockquote>
<pre>
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"
</pre>
</blockquote>


* color + root/username
== ~/.bash_aliases ==
<blockquote>
<blockquote>
<pre>
<pre>
if [ "$color_prompt" = yes ]; then
touch .bash_aliases
    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
</pre>
</pre>
</blockquote>
</blockquote>
* systemctl without page breaks
<blockquote>
<pre>
alias systemctl='systemctl --no-pager'
</pre>
</blockquote>
[[Category:Linux/CheatSheet]]
[[Category:Linux]]

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'