💾 Archived View for tilde.town › ~mikewilsonstl › files › dotfiles › cd-upgrade.gmi captured on 2024-09-29 at 00:18:44. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-05-10)

-=-=-=-=-=-=-

$cd upgrade

I don't know about you, but for me, every time I run "$ cd" I always end up running "$ ls -A" right afterwards. It's not something I thought much about but I wondered if there was a way to automate that.

Adding the following code snippet to my .bashrc file put these two functions together and it's made my directory traversal much smoother!

function cd() {
    new_directory="$*";
    if [ $# -eq 0 ]; then 
        new_directory=${HOME};
    fi;
    builtin cd "${new_directory}" && ls -A
}

back to dotfiles

back to homepage

back to tilde.town