28

In Terminal, how do I go from Macintosh HD to places such as johnsmith that contains Downloads, Desktop etc. In a Finder window, it seems they are independent of each other.

From Macintosh HD, I see Library, Applications etc. but under User I couldn't find johnsmith.

The Mac file tree is rather confusing for a Windows user like me who are used to "My Computer" then all files are managed by root drives and folders. What is consider as root on my Mac? Is it Macintosh HD or johnsmith? It is possible to do a partition on Mac like that on Windoes?

1
  • 1
    Mac OS X with one hard disk is like Windows with one hard disk. Your home directory is at /Users/johnsmith. May 14, 2012 at 15:13

8 Answers 8

28

You can find the location to your home directory by looking in the "Users & Groups" System Preference pane.

  1. Open "System Preferences" application
  2. Click "Users & Groups"
  3. Click the padlock to unlock it, if it is not already unlocked. Enter user name and password for an Admin user.
  4. Right click on the User name you want to find the home directory for, select "Advanced Options..."
  5. Observe the path as noted next to "Home directory:"

System Preferences:Users & Groups: Advanced Options

Now, once you see where OS X thinks your home folder is located then you can work on un hiding it if it is not showing up where it is suppose to be.

Make sure its name does not start with ".", Additionally you can use the SetFile -a v /pathToHome command to make it visible if it appears to be hidden for no apparent reason.

12

To find where it is, open Terminal and type pwd for "Print Working Directory". This works because the Terminal opens in your home folder by default.

You can move to your home folder in terminal by typing one of cd (defaults to your home folder), cd $HOME (moves to the location in that environment variable), or cd ~ (a shortcut for home), or cd /Users/johnsmith/ (the absolute path).

4

OS X is Unix-based so there is only one big filesystem visible to the user, even if it is distributed across several partions. This also applies to external drives which are accessible under /Volumes/NAME-OF-DRIVE.

The individual user home folders (which contain all the nice stuff like Downloads, Documents etc.) are available in /Users, each user has his/her own directory there with a name matching their short name. Type ls -l /Users in Terminal to see all of them.

And to actually "go" there, enter cd ~johnsmith (for user johnsmith) or just cd (for your own home folder), followed by ls -l to see the content.

4
  • in my User's there's only "Shared"....
    – KMC
    May 14, 2012 at 7:36
  • 1
    Strange indeed, can you share a picture? In addition, open a Finder window for your home folder and Command-Click on the window title to show the folder hierarchy it resides in.
    – nohillside
    May 14, 2012 at 7:39
  • 2
    Also, report the results of echo ~ -- that should print where your home folder is. May 14, 2012 at 15:36
  • The folder may be hidden. You could try SetFile -a v /Users/johnsmith in Terminal to make it visible again.
    – mckeed
    May 14, 2012 at 23:51
4

Normally, your user folder is located at /Users/johnsmith/.

However for the case that you are in Recovery Mode, your user folder is located at /Volumes/Mac/Users/johnsmith/. This is because Recovery Mode is like another operation system started from another disk partition, so the disk partition with your main system appears as a mounted volume (like an external hard disk does normally).

1
  • For the latest Mac OS, it is /Volumes/Macintosh\ HD/Users
    – Cheng
    Jan 28, 2018 at 12:00
1

To get path into Terminal without a lot of typing:

  1. Open a Terminal window.

  2. In Finder, navigate to the folder (or file) you want, and drag its icon onto Terminal window.

The appropriate path string will appear in the terminal window.

0

Your home directory should be /User/$USER

$USER is a variable so it is not really $USER

Type in the terminal "echo $USER" and replace $USER in the first line of my answer with the output, that's your home folder.

-2

Very easy solution:

In "Finder", choose "Preferences". Click on the "Sidebar" tab, and under the "Favorites" column, there should be your user name (usually your name: "firstlast"). Check the box. Now when you open finder, you should see your user name, and when you click on it, you will see the directory of all your files. :-)

1
  • Peter, the question is specifically about finding the User folder inside Terminal.
    – owlswipe
    Sep 9, 2016 at 20:48
-2

An easy way/hack I just found out without having to go through all the steps/stress in the accepted answer...

In Finder,

  1. Click one of the tabs to the left, say, Documents;
  2. On the very top menu bar, click Go > Enclosing Folder;
  3. Repeat step 2 (two times more/less) until you see the Users directory side by side with directories like System, Library etc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .