Each account has a directory for its own files. This is its home directory.
- /
- home
- learner← your home directory
- notes.txt
- shop
- ana
- ben
- root← home directory of root
| Account | Home directory |
|---|---|
A normal account, such as learner | /home/learner |
The administrator account, root | /root |
~ is a short name
~ is a short name for your home directory. The shell changes it to the full path before the command starts:
text
learner@tidepool:~$ cat ~/shop/prices.txt
tea 4.50
coffee 3.20For the account learner, ~/shop/prices.txt is the same as /home/learner/shop/prices.txt.
The value of ~ depends on who types it. For ana, ~ is /home/ana.
The ~ in the prompt
In Chapter 1, the prompt learner@tidepool:~$ had a ~ that you did not read yet. Now you know: it is your home directory. The next lesson explains why the prompt shows it.