Navigating at the command line

stupid ideas slackathon logo

People say "real life" is the thing, but I prefer the command line. I live there all day.

One thing I recommend for your powershell profile, is this little piece of ascii art:

function ..() { cd ..}
function ...() { cd ..\..}
function ....() { cd ..\..\..}
function .....() { cd ..\..\..\..}
function ......() { cd ..\..\..\..\..}
function .......() { cd ..\..\..\..\..\..}
function ........() { cd ..\..\..\..\..\..\..}
function .........() { cd ..\..\..\..\..\..\..\..}
function ..........() { cd ..\..\..\..\..\..\..\..\..}
function ...........() { cd ..\..\..\..\..\..\..\..\..\..}
function ............() { cd ..\..\..\..\..\..\..\..\..\..\..}

It's super helpful when you're navigating around.

If you want to move "up" by 3 folders, you just type "...."

In bash you can put an equivalent thing in your profile.

alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias .......='cd ../../../../../..'
alias ........='cd ../../../../../../..'
alias .........='cd ../../../../../../../..'

For bonus points, don't use cd -- use pushd instead (it works in bash, powershell, even DOS) -- and it means you can return to a previous location with popd.

 

I'm currently writing a book about how to build your first product. If you want to build your first product, please sign up to be notified when the book is available.

(By the way, I read every comment and often respond.)

Your comment, please?

Your Name
Your Url (optional)
Note: I may edit, reuse or delete your comment. Don't be mean.