Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Is the ~ really superfluous in a cd ~- type command?




On 16/03/2022 15:51, Mikael Magnusson wrote:
On 3/16/22, zzapper <zsh@xxxxxxxxxxxxxx> wrote:
Hi

cd - or cd ~-

cd -1 or cd ~-1

seem to do the same thing
Yes, cd handles -num itself, but for other commands you need the expansion.

ahh! yes with cd -num you can cd successfully but you DON'T get tab expansion

So there's a great benefit to using tilda

cd ~4<tab>

cd /aaa/<tab>

cd aaa/sub etc


# if you want a quirk

~ on its own takes you to your home directory If you've got 'setopt autocd'

zzapper







Messages sorted by: Reverse Date, Date, Thread, Author