Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Seems like as good a time as any to show off this cursed thing I keep in my dotfiles:

    # Allow .. through ........... (yup!) to cd up some number of directories.
    for i in {1..10}; do
        spaces=$(printf "%${i}s")
        alias "${spaces// /.}."="cd ${spaces// /../}"
    done
Going into it, I thought it would be something I'd use all the time. In practice all I ever use is `..` and not nearly as much as I originally imagined I would.


I have something similar (though less elegant). I find the best use case to be hitting ..........<RET> to get to root (in conjunction with zsh auto_cd option), rather than typing `cd /`.


I use something similar: .. , .2 , .3 , etc.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: