I add an alias to `~/.bashrc and activate it.

    # add some helpful aliases
    alias l.='ls -d .* --color=auto'

Activate it

source .bashrc

It work well on current bash.

    $ l.
    ls: --color=auto: No such file or directory
    .   .cups   .python_history  ...

Unfortunately, it refuses to work when I quit and restart the bash

    $ l.
    -bash: l.: command not found

It has to be activated manually again.

  $ source .bashrc
  # then it works
    $ l.
    ls: --color=auto: No such file or directory
    .   .cups   .python_history  ...

What's the problem with my configuration?


Terminal opens a login shell. The config file is .bash_profile!

You either have to source .bashrc in .bash_profile or add the alias to .bash_profile.

The proper alias would be: alias l.='ls -dG .*' (to get rid of ls: --color=auto: No such file or directory!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .