Get other users homes in Linux by using tilde

Adding a username to ~ will expand it to the home directory of this specific user:

$ echo ~dmitritelinov
/home/dmitritelinov
$ echo ~nobody
/nonexistent
If the given user name does not exist then it doesn’t expand to something:
$ echo ~ftp
~ftp
Bash’s tilde expansion retrieves this information from the password database using the getpwent() function