what does "~/." mean in terms of OS X folders/directories?

15

4

I'm installing a program on my MacBook that has to be unzipped to the ~/.spring directory; now, I know what Spring is, it's the name of the thing I'm installing. I'd be very happy to create a .spring folder if I knew what ~/. meant.

Ryan

Posted 2010-06-30T19:01:16.747

Reputation: 163

3Note: ~/. by itself means something different than when it is a prefix of something longer. On its own, it is a longer way of writing ~, both of which indicate the home directory. As a prefix (e.g ~/.spring) it indicates a “hidden” entry in the home directory. – Chris Johnsen – 2010-06-30T20:59:00.057

Answers

20

The tilde symbol (~) in OS X command-line terminology refers to your home directory, e.g /Users/Joe.

As JonathanMueller pointed out, anything with a dot (.) in front, is considered hidden. Thus, what your program needs you to do is to:

  1. Fire up Terminal
  2. cd ~ (goes to your home directory)
  3. mkdir .spring (creates a hidden spring directory)

You will not be able to see this folder in Finder, as it is hidden, but going to Terminal and using ls -a while in Terminal will show up the hidden folders.

caliban

Posted 2010-06-30T19:01:16.747

Reputation: 18 979

5

~ is a reference to the home directory. A dot directory is a "hidden" directory in UNIX.

JonathanMueller

Posted 2010-06-30T19:01:16.747

Reputation: 271

anything with a dot append in front is hidden in Unix, but in this case, a singular dot refers to the current directory, which is Home. – caliban – 2010-06-30T19:07:15.250

@caliban You sure about that? If the dot in ~/.spring refers to the current directory, OS X strayed a lot farther from its Unix origins than I had imagined. – coneslayer – 2010-06-30T19:55:07.427

1@caliban, a single dot refers to the current directory and two dots refer to the parent directory, but this question was about .spring, which would be a hidden directory. Thanks for pointing out the possible confusion. – JonathanMueller – 2010-06-30T20:06:04.357

0

To view 'hidden' files, use

ls -a

or add -a to your usual 'ls' arguments. The -a flag is implied if you have superuser privs.

Nevin Williams

Posted 2010-06-30T19:01:16.747

Reputation: 3 725

Or -A to not display the . and .. entries. – Daniel Beck – 2013-04-12T14:55:11.437