Home Is Where the Heart Is

This guide is mainly written for folks who are new to macOS and/or the command line, but even those who are more experienced might learn a new shortcut.

I often refer to the "Home" folder. This is the folder named after your macOS username, and has a house icon next to it in the Finder. It is inside the top-level Users folder. There are many roads that lead to Home.

Find your way Home

The Finder is one way to get to your Home. You can open the Finder in many ways:

If you don't have any open Finder windows, a new one will open automatically when you reach the Finder via the Dock or Spotlight, but not when cycling through the open apps. Either way, once the Finder is the current active app, you can get to Home by going to the Go menu, and then choosing Home, or by typing the keyboard shortcut shift-command-H. Here's a screenshot from my Mac:

macOS home folder

By default, I believe new Finder windows show the Recents folder. I prefer to have Home as the default. If you're like me, you can change your preferences by going to the Finder, then pressing command-comma, which is the universal keyboard shortcut for most apps' preferences, then click the General tab, and in the dropdown labeled New Finder windows show:, choose your Home folder. This, and many other preferences can also be set from the command line/terminal, as we'll see in an upcoming guide.

Search your way Home

Another way to get to Home is via Spotlight. Press command-spacebar, and then type in your username, then press return.

Browse your way Home

This is more fun than practical, at least for me, but you can enter file:///Users/your_username (replace your_username with your own username) in Safari's URL bar, and it will open your Home folder. Note that there are 3 forward slashes after file:. In other browsers, like Firefox and Chrome, it will show you the contents of your Home folder, and you can keep navigating through your computer's contents that way.

Last stop: Home

This brings us to the terminal. When I use the lowercase term "terminal", I am referring to any terminal emulator, not specifically the Terminal app on macOS. When I use the capitalized Terminal, I am referring to the app. The most popular terminal emulators are the macOS Terminal, iTerm2, and Hyper. I use iTerm2, but I've been meaning to give Hyper a try.

The fastest way to open the Terminal app is with Spotlight: command-spacebar, then start typing terminal until it appears, then press return. By default, when you open a new Terminal window, it will put you inside your Home folder, which is represented by the ~ symbol. The default folder that you land on when you open new windows and tabs can be customized via the Terminal's General preferences. If you use another terminal app, it most likely has similar preferences.

To verify that you are indeed in your Home folder, you can run the command pwd, which stands for "print working directory". Whenever I say "run a command", I mean "type the command in your terminal, then press return". When you run pwd while in your Home folder, you should see /Users/ followed by your username. In my case, it's /Users/moncef.

The ~ symbol is a shortcut you can use in any command as opposed to typing the full path to your home folder. For example, if you are not in your Home folder in the terminal, you can get back home by running cd ~. cd stands for "change directory" and is what you use to go from one folder/directory to another.

In my guides, and in other tutorials out there, you will often see references to files like ~/.bash_profile or ~/.zshrc. This means a file called .bash_profile inside your Home folder. When you see instructions to add something to ~/.bash_profile, that means you need to open the file .bash_profile that's in your Home folder, and then copy and paste the text that you were told to add, usually at the end of the file. Files that start with a period, also known as dotfiles, are hidden from the Finder by default. Learn how to view, open, and edit hidden files from the Finder or terminal by reading my guide. To learn more about why these specific files are referenced in development tutorials, and to figure out which one you need to edit, read my guide on shells.

I will leave you with a tune that goes well with this post: Come On Home by The Horace Silver Quintet.