Hacker News new | ask | show | jobs
by mbivert 694 days ago
Not strictly equivalent, but shorter (and should work with multiple shells):

  $ cd() { builtin cd $* && ls; }
  $ cd /
  bin  boot cdrom  dev  etc  home  lib  lib64 [...]
1 comments

$* will break on directory names containing spaces and other bash "word" delimiters, use "$@":

    cd() { builtin cd "$@" && ls; }