Can I modify a terminal command to do additional stuff? I've looked into aliases, functions... but I have not come up with anything satisfying. Let me give you a couple of scenarios:


95% of times that I cd into a folder, I follow up with a ls
command.
90% of times that I mkdir, I cdmyself into it.


You get the idea.

What would be the "cleanest" way to bind those commands together (or other functionality)?
I'd tend to make a new command for this. I think it would even be logical to combine them into a single one.

go() {
    if [ -d "$1" ]; then
        cd "$1" &amp;&amp; ls
    else
        mkdir -p "$1" &amp;&amp; echo "Created directory $1" &amp;&amp; cd "$1"
    fi
}