Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As I understand it, ~+ means the same thing as "the current working directory".

So echo ~+ should print the same as pwd.

What is the purpose of this tilde expansion ~+ ?

share|improve this question
It's not as portable compared to $PWD. – jw013 May 2 '12 at 21:17
~- works as well... – polemon May 2 '12 at 22:21
@polemon, ~- only works if you haven't already run pushd. It means the last directory in the stack, not the first. – Mikel May 2 '12 at 22:39
Hmm, ok. Didn't even know that. – polemon May 2 '12 at 23:14
up vote 3 down vote accepted

It's there for completeness.

You could use it as a shorter form of $PWD. You save a whole two keystrokes!

share|improve this answer
I save three with my keyboard layout :) – Marco May 3 '12 at 0:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.