8

I have created a virtual image for Scientific Linux and came across this after I finished installing it:

[root@ftpserver home]# pwd
/home
[root]@ftpserver home]# ls

When I cd into ~ I get this:

[root@ftpserver ~]# pwd
/root

What is the overall difference between /home and /root?

15

According to the Filesystem Hierarchy Standard (FHS):

/home : User home directories (optional)
/root : Home directory for the root user (optional)

A typical non-root user's home directory would be /home/$USER. /root is also special in that (in many distros) /root is readable only to root (700), but a normal user's home directory has read access to others (755) as well.

5

In case of trouble during booting (resulting in other volumes not being mounted) it helps that root (which is used for repair logins) has its home directory available. /home is often on a different volume.

3

/home is where all users usually get their home directories created under.

Examples:

/home/marcelo
/home/joe

The /home may sometimes reside in a different filesystem (i.e., a separate harddisk, another partition in the same harddisk or even network mounted) than the / (main system's filesystem).

For this (and probably other reasons as well), the root user's home directory is normally in a separate directory that resides in the main system's filesystem, thus not risking the chances of not being mounted due to network connectivity or other issues.

All this is configurable and, theoretically, you could have your system root's home under /home as well, for example /home/root, but this is not recommended.

The ~ symbol is just something the shell replaces with the current user's home directory. It is not, per se, a valid path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.