Command Line

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:

echo ~

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:

echo $HOME

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.

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.

Recent Posts

Enable/Disable Your Network Interface

Today we'll cover one way to enable or disable your network interface in the Linux…

5 months ago

Check Your NIC Speed In The Terminal

Today's exercise is a nice and simple exercise where we check your NIC speed in…

5 months ago

Easily Monitor Your Wireless Connection

Have you ever wanted to easily monitor your wireless connection? Well, now you can learn…

6 months ago

Count The Files In A Directory

I think I've covered this before with the ls command but this time we'll count…

6 months ago

Get System Information With The ‘uname’ Command In Linux

Today we'll be learning about a basic Linux command that's known as 'uname' and it…

6 months ago

hardinfo Has Been Rebooted As hardinfo2

If you've used hardinfo in the past, it may interest you to know that hardinfo…

6 months ago