0

This question already has an answer here:

When I first log in to Unix on my Mac, I usually see a ~ after my username in the command line.

However, if I look at the apps contained in that directory ~/Applications they are not all of my applications, but rather just some of my chrome apps.

If I cd to my / directory, and then go to /Applications there I see all of my applications, so I am wondering what is the difference?

Also, if I go to ~/MY-USERNAME/Applications I see the same as if I just I were just in ~. So what is the difference?

Lastly, how come I can cd into my USERNAME directory endlessly? (see screen shot, "startec" is my username)

my command line

marked as duplicate by Patrick, jasonwryan, Gilles command-line Jul 10 '14 at 23:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Also, for your last question, you have apparently created a symlink called Startec that points to your home directory. If you use ls -l you'll probably see an entry that shows either Startec -> . or Startec -> /Users/Startec. – Greg Hewgill Jul 10 '14 at 20:09
  • Yes! That is it, I must have forgotten about that. – Startec Jul 10 '14 at 20:13
2

~ is your home directory, / is the root directory. ~ is where you keep your personal files and directories. Other users can't see or access them. Files and directories in / are system-wide and accessible to all users who have the right permissions.

Startec is a link, which allows you to have two pointers to the same directory (in this case it points to your home directory). I know that most people draw the file system strictly as a tree, but with links (hard or soft) this isn't completely true.

To create links you can use the ln command. To see more about those see, man 1 ln.

Here is a diagram of a unix file system with links shown in dotted lines, and directories with solid lines.

unix file system

Source: http://users.aber.ac.uk/cwl/UNIX/notes/filesystem/fs.html

  • So my user directory (~) is under usr in this graph? Also, when I run ls, I see usr but also Users, and am not sure of the difference. – Startec Jul 10 '14 at 20:21
  • Mac OS X uses different names than the image in the above answer. User home directories are under /Users. – Greg Hewgill Jul 10 '14 at 21:09
  • Though, in the above graph, there should be an extra point under / called home. Under the home directory are users' ~ in many *nix OSs. – HalosGhost Jul 10 '14 at 22:27
  • If I recall, Mac OS X has user directories under /Users/user_name/. If you cd ~/, then pwd, you can see what your file path is. That would be better than any of my guesses. – Evan Jul 10 '14 at 23:24

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