Change directory upwards to specified goal

Posted by haakon on Super User See other posts from Super User or by haakon
Published on 2010-06-01T18:49:14Z Indexed on 2010/06/01 18:56 UTC
Read the original article Hit count: 203

Filed under:
|
|

I'm often deep inside a directory tree, moving upwards and downwards to perform various tasks. Is there anything more efficient than going 'cd ../../../..'?

I was thinking something along the lines of this: If I'm in /foo/bar/baz/qux/quux/corge/grault and want to go to /foo/bar/baz, I want to do something like 'cdto baz'. I can write some bash script for this, but I'd first like to know if it already exists in some form.

© Super User or respective owner

Related posts about linux

Related posts about bash