You could replace cd
with a shell function in your ~/.bashrc
or similar startup script:
function cd {
builtin cd "$@"
RET=$?
ls
return $RET
}
this would also return the exit code of cd
, just in case...
builtin
is a shell builtin to execute the shell builtin cd
instead of the cd
funciton, to avoid running into a recursive loop - at least in bash - but should also work with other shells...