- Offizieller Beitrag
Wie aktiviere ich die Autovervollständigung für den User Root?
Einleitung:
Wer als root auf einem Terminal arbeitet wird eines sofort vermissen, die Autovervollständigung von Befehlen mittels der <tab> Taste. z.b. apt-get i <tab> <tab> wird zu apt-get install
Es gibt 2 Wege um dies zu erreichen. einmal explizit für den User root und einmal global für alle user im System. Ich werde beide beschreiben.
Vorrausetzung:
als user root am System angemeldet
Root - Schritt 1:
Öffnen der /root/bashrc
Root - Schritt 2:
entfernt die # von folgenden Zeilen
Vorher
Code
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
# . /etc/bash_completion
#fi
Nachher
Code
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
Root- Schritt 3:
Übernehmt die Änderungen
Global - Schritt 1:
Öffnen der /etc/bash.bashrc
Global- Schritt 2:
entfernt die # von folgenden Zeilen
Vorher
Code
# 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
Nachher
Code
# 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
Global- Schritt 3:
Übernehmt die Änderungen