zsh-users
 help / color / mirror / code / Atom feed
* Is the ~ really superfluous in a cd ~- type command?
@ 2022-03-16  9:29 zzapper
  2022-03-16 15:51 ` Mikael Magnusson
  0 siblings, 1 reply; 3+ messages in thread
From: zzapper @ 2022-03-16  9:29 UTC (permalink / raw)
  To: Zsh-Users List

Hi

cd - or cd ~-

cd -1 or cd ~-1

seem to do the same thing

# an odd one?

cd -- same as cd ~



zzapper



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Is the ~ really superfluous in a cd ~- type command?
  2022-03-16  9:29 Is the ~ really superfluous in a cd ~- type command? zzapper
@ 2022-03-16 15:51 ` Mikael Magnusson
  2022-03-16 16:06   ` zzapper
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Magnusson @ 2022-03-16 15:51 UTC (permalink / raw)
  To: zzapper; +Cc: Zsh-Users List

On 3/16/22, zzapper <zsh@rayninfo.co.uk> 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.

> # an odd one?
>
> cd -- same as cd ~

cd without arguments goes to the home directory.

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Is the ~ really superfluous in a cd ~- type command?
  2022-03-16 15:51 ` Mikael Magnusson
@ 2022-03-16 16:06   ` zzapper
  0 siblings, 0 replies; 3+ messages in thread
From: zzapper @ 2022-03-16 16:06 UTC (permalink / raw)
  To: Zsh-Users List


On 16/03/2022 15:51, Mikael Magnusson wrote:
> On 3/16/22, zzapper <zsh@rayninfo.co.uk> 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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-16 16:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16  9:29 Is the ~ really superfluous in a cd ~- type command? zzapper
2022-03-16 15:51 ` Mikael Magnusson
2022-03-16 16:06   ` zzapper

Code repositories for project(s) associated with this inbox:

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).