Mainos / Advertisement:


From Taisto
Jump to navigation Jump to search
This page is a translated version of the page Bashrc and the translation is 100% complete.

Other languages:
English • ‎suomi

By modifying the /etc/bash.bashrc file you can do a lot of funny stuff to bash

nano /etc/bash.bashrc

By default it should be like

[ -z "$PS1" ] && return
shopt -s checkwinsize
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
   debian_chroot=$(cat /etc/debian_chroot)

And we modify it into:

[ -z "$PS1" ] && return
shopt -s checkwinsize
if [ $(id -u) -eq 0 ];
PS1="\\[$(tput setf 5)\\]\\u@\\H:\\w #\\[$(tput sgr0)\\]"
PS1="[\\u@\\h:w] $"

If you want to allow bash for all users, modify


and remove the number sign (#)


When tab (auto completion) does not work in "interactive shells" (e.g. ssh)

Uncomment the following lines.

# enable bash completion in interactive shells
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
#    . /etc/bash_completion

Like so

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion

We close the connection and restart. Auto completion should function properly.

Mainos / Advertisement: