Does Root Have a Home Directory on Linux?

Share

Yes, it's /root on Linux Mint.

How to Get The Home Directory of Root?

To get the home directory of the root user on Linux, you can use the following terminal commands:

me> su -
Password: *******
root> echo $HOME
/root 

The command su - switches to a different user changing the environment variables (the dash (-) argument does this, so it's important!). The home directory's filepath is contained the $HOME environment variable, so all you need to do is echo it.

Written by Noel Santos.

About the Author

I'm a self-taught Brazilian programmer graduated in IT from a FATEC. In a world of increasingly complex and essential computers, I decided to use my technical expertise in hardware, desktop applications, and web technologies to create an informative resource to make PC's easier to understand.

View Comments