How to get home directory of a prticular user in bash scripting or a single command

The below command gets the home directory of user if at all the user exists
 
getent passwd naresh | cut -f6 -d:

1 comment: