OnWorks Linux and Windows Online WorkStations

Logo

Free Hosting Online for WorkStations

< 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


Top OS Cloud Computing at OnWorks: