Advanced directory switching in bash -


i know few advanced ways, change directories. pushd , popd (directory stack) or cd - (change last directory).

but looking quick way achieve following:

say, in rather deep dir:

/this/is/a/very/deep/directory/structure/with\ lot\ of\ nasty/names 

and want switch

/this/is/another/very/deep/directory/structure/with\ lot\ of\ nasty/names 

is there cool/quick/geeky way (without mouse)?

do mean path names same, , 1 directory name changes ("a" becomes "another")? in case:

cd ${pwd/a/another} 

will switch other directory. $pwd holds current directory, , ${var/foo/bar} gives $var string 'foo' replaced 'bar'.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -