Go to the previous, next section.

Tilde Expansion

Bash has tilde (~) expansion, similar, but not identical, to that of csh. The following table shows what unquoted words beginning with a tilde expand to.

~
The current value of $HOME.
~/foo
`$HOME/foo'

~fred/foo
The subdirectory foo of the home directory of the user fred.

~+/foo
`$PWD/foo'

~-
`$OLDPWD/foo'

Bash will also tilde expand words following redirection operators and words following `=' in assignment statements.

Go to the previous, next section.