Ich füge einen Alias zu `~/.bashrc hinzu und aktiviere ihn.
# add some helpful aliases
alias l.='ls -d .* --color=auto'
Aktivieren Sie es
source .bashrc
Es funktioniert gut auf der aktuellen Bash.
$ l.
ls: --color=auto: No such file or directory
. .cups .python_history ...
Leider funktioniert es nicht, wenn ich die Bash beende und neu starte
$ l.
-bash: l.: command not found
Es muss wieder manuell aktiviert werden.
$ source .bashrc
# then it works
$ l.
ls: --color=auto: No such file or directory
. .cups .python_history ...
Was ist das Problem mit meiner Konfiguration?
Terminal öffnet eine Login-Shell. Die Konfigurationsdatei ist .bash_profile!
Sie müssen entweder .bashrc in .bash_profile beziehen oder den Alias zu .bash_profile hinzufügen.
Der richtige Alias wäre: alias l.='ls -dG .*'
(to get rid of ls: --color=auto: No such file or directory
!