I know a few advanced ways, to change directories. pushd and popd (directory stack) or cd - (change to last directory).
But I am looking for quick way to achieve the following:
Say, I am in a rather deep dir:
/this/is/a/very/deep/directory/structure/with\ lot\ of\ nasty/names
and I want to switch to
/this/is/another/very/deep/directory/structure/with\ lot\ of\ nasty/names
Is there a cool/quick/geeky way to do it (without the mouse)?
Do you mean that the path names are the same, and only one directory name changes (‘a’ becomes ‘another’)? In that case:
will switch to the other directory.
$PWDholds your current directory, and${var/foo/bar}gives you$varwith the string ‘foo’ replaced by ‘bar’.