Jack Wallen explains what the Linux home directory is for new users.
In Linux, there’s no place like ~/, or $HOME or just home. That’s right, three ways to say the same thing. For new Linux users, this can get confusing. First off, what is home? Why are there numerous ways to notate home? Let’s see if we can solve this puzzle together.
First off, home is where the heart of your Linux user experience lives—a special directory that houses all of your user files. Your home directory is typically found in /home/USER (where USER is your Linux username).
If you issue the command ls /home, you’ll see all of the users that have directories within /home. However, if you issue the commands ls $HOME or ls ~/, you’ll see a listing of all the files and directories found in your home. Both $HOME and ~/ are just alternative ways of typing /home/USER.
SEE: Kubernetes: A cheat sheet (free PDF) (TechRepublic)
Although you’ll find other user’s home directories in /home, that doesn’t mean you have full access to their data. Yes, you can view their files, but you can’t edit them. Soon, thanks to an addition to systemd, you probably won’t even be able to view the data in other user’s home directories.
In home, you’ll typically find sub-directories for Documents, Downloads, Pictures, Videos and more. In other words, it’s your own special place to save files. Home also contains many of the configuration files for the apps you use.
When you log in to your Linux account, the system will read your bash configurations (such as .bashrc) and set your environment accordingly. Within the .config folder, found in your home directory, all of the software you use will enjoy your personal configuration options.
If you’re coming from Windows 10, home is equivalent to C:UsersUSERNAME (where USERNAME is your Windows username). If you’re coming from macOS, home is equivalent to /Users/USERNAME (where USERNAME is your macOS username).
In the end, home shouldn’t be a mystery to anyone who’s used a computer enough to understand where their files and folders are housed in relation to the directory hierarchy. Just remember, $HOME is where the heart is.
Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.