假设我有以下目录结构(变量是z
或y
或x
或w
目录):
/a/b/c/d/e/z/f/g/h/i/j/k
/a/b/c/d/e/y/f/g/h/i/j/k
/a/b/c/d/e/x/f/g/h/i/j/k
/a/b/c/d/e/w/f/g/h/i/j/k
我如何为cd
命令编写别名(在bash中),这样当我在
/a/b/c/d/e/w/f/g/h or in
/a/b/c/d/e/w/f/g/h/i/j or in
/a/b/c/d/e/w/f/g/h/i/j/k
并输入:
cd z
分别 带我进入
/a/b/c/d/e/z/f/g/h or in
/a/b/c/d/e/z/f/g/h/i/j or in
/a/b/c/d/e/z/f/g/h/i/j/k
如果我输入:
cd y
分别 带我进入
/a/b/c/d/e/y/f/g/h or in
/a/b/c/d/e/y/f/g/h/i/j or in
/a/b/c/d/e/y/f/g/h/i/j/k
当然如果我输入:
cd w
它应该让我离开我(已经在那里)。