Automatically ls after cd (improved)

Here’s the new and improved version. This will properly handle a cd with no arguments.

alias cdd="builtin cd"
cd () {
        if [ "$*" = "" ]; then
                builtin cd ~
                builtin cd "$*"
                        if [ $? -eq 0 ]; then
                                        ls --color=always

One thought on “Automatically ls after cd (improved)

  1. Pingback: Automatically ls after a cd | Nishant Kanitkar

Leave a Reply

Your email address will not be published. Required fields are marked *