Locate Your Home Directory

Today’s article will not be long, nor will it be a complicated article, as we learn how to locate your home directory. This is something you probably already know, but you may encounter a strange system where things are a little different. It can happen.

More importantly, this article is going to try something new. Rather than a very long article, it’s going to be a short article. Well, shorter than most – assuming I stop puffing it up with text such as this. Why? Well, I want to see the reception and the statistics.

So, basically, every user account you’re likely to use should have a home directory. This is where the user’s files, customizations, and settings reside. Not every user has a home directory, but the accounts you’d normally use (that is log into and operate) will likely have such a directory. However, you don’t have to have a home directory – though you can expect some weirdness without one.

How To: Create a New User Without a /home Directory

The usual home directory will be in /home/<user> and that’s pretty much the standard we’ve come to know and love. You really shouldn’t need to locate your home directory, but there comes a time when you just might want to.

So, that’s what this article covers. It covers how to…

Locate Your Home Directory:

So, we’ll be doing this in the terminal. That’s a nice place to do things. Press CTRL + ALT + T and your default terminal should open. If it doesn’t open, pick a better distro!

Nah, just open it from your application menu and love the distro you’ve chosen.

We’ll just be covering a couple of quick ways to locate your home directory. That’s all this article is and there’s no reason to turn it into a longer article. We’ll do them both with the echo command. See man echo for more details.

First, you can try this command:

As you should know by now, the tilde (~) is a shortcut for your home directory and it works just fine in this use case.

There’s another echo command you can memorize, but slightly longer:

That command uses both the echo command and an environment variable, specifically $HOME (obviously). This will happily echo the results, sending them to your standard output. This can be quite useful if you’re into scripting or the like.

See also:

How To: Show All Environment Variables

I told you that this wouldn’t be long or complicated. You can now locate your home directory from the Linux terminal.

Closure:

As I said, I figured I’d try the opposite of what I’ve been trying lately. My most recent articles have been quite long and quite detailed. I like them. I enjoy writing them. This time around, it seemed like a good idea to try something different with a subject that benefits from brevity.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Subscribe to Newsletter!
Get notified when new articles are published!
We promise to never share your email!
icon

Author: KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any spam.
Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.