I'm trying to have a shortcut for going back a few dirs. Something like "cd ...." == "cd <number of dots - 1> * '../'"
- I tried doing alias '...'='../..' && cd ... but got "No such file or directoy"
- I then tried doing alias '...'='../..' but got "invalid alias name"
- I guess I can create a function:
function bla { for i in $(seq $(($1 - 1))); do cd ../; done; }; bla 3
but that seems less elegant (and also I cd ../ one in a time which is bad (cd -
won't have the desired effect for example) but I can concat the strings and only cd at the end)
My questions are: How to solve (1) & (2) and is there a neater way for this?