On 06/16/2010 01:04 PM, Clark J. Wang wrote:
On Sun, Jun 13, 2010 at 7:46 PM, Peng Yu<pengyu...@gmail.com>  wrote:

Hello,

I frequently need do cd multiple levels up. For example,

cd ../..
cd ../../../../

It would be convenient to type something like "cd 2" or "cd 4". Is
there a command for this?

--
Regards,
Peng

My way:
I wrote a compgen function for cd and it behaves like this: when you type
`cd .....' on the command line and then press TAB, the command line becomes
`cd ../../../../', then you can continue editing it to be `cd
../../../../other-dir/' and press ENTER.
I'm against changing the behaviour of cd. It means, when you have directory name with dots, you will not be able to cd into it. Right, not directly like `cd ....', but using `cd ./....' will probably work. I just want to let you know about it :)

RR

Reply via email to