< Previous | Contents | Next >
Tilde Expansion
As we may recall from our introduction to the cd command, the tilde character (“~”) has a special meaning. When used at the beginning of a word, it expands into the name of the home directory of the named user, or if no user is named, the home directory of the cur - rent user:
[me@linuxbox ~]$ echo ~
/home/me
[me@linuxbox ~]$ echo ~
/home/me
If user “foo” has an account, then:
[me@linuxbox ~]$ echo ~foo
/home/foo
[me@linuxbox ~]$ echo ~foo
/home/foo