by tutipop · 2y ago · 0 comments
_chpwd_hook() {
if [[ "$PWD" != "$PREVPWD" ]]; then
ls
PREVPWD="$PWD"
fi
}
PROMPT_COMMAND=(_chpwd_hook)
Goes well with shopt -s autocd
alias r='cd -' $ cd() { builtin cd $* && ls; }
$ cd /
bin boot cdrom dev etc home lib lib64 [...] cd() { builtin cd "$@" && ls; }