Mainos / Advertisement:

Ero sivun ”Bashrc” versioiden välillä

Kohteesta Taisto
Siirry navigaatioon Siirry hakuun
Rivi 29: Rivi 29:
  
 
   force_color_prompt=yes
 
   force_color_prompt=yes
 +
 +
 +
 +
== Kun tab (auto completion) ei toimi "interactiivisissa shelleissa" (esim. ssh) ==
 +
 +
Otetaan kommenttimerkit pois seuraavista riveistä.
 +
 +
# enable bash completion in interactive shells
 +
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
 +
#    . /etc/bash_completion
 +
#fi
 +
 +
Näin
 +
 +
# enable bash completion in interactive shells
 +
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
 +
#    . /etc/bash_completion
 +
#fi

Versio 20. marraskuuta 2014 kello 06.35

Muokkaamalla /etc/bash.bashrc tiedostoa voi tehdä kaikkea hauskaa bashille

nano /etc/bash.bashrc

nyt siellä alussa on näin

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

Muokataan siitä tällainen:

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

Jos haluat sallia kaikille käyttäjille, muokkaa

 /home/%USERNAME%/.bashrc

ja poista risuaita

 force_color_prompt=yes


Kun tab (auto completion) ei toimi "interactiivisissa shelleissa" (esim. ssh)

Otetaan kommenttimerkit pois seuraavista riveistä.

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

Näin

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