bash functions for cda, cdg and cd.