Skip to main content

Getting another user's home directory from bash script

To find another user's home folder in a bash script:
# getent passwd <username> | cut -d: -f6

for example:
# getent passwd nfsnobody | cut -d: -f6
/var/lib/nfs

Comments

Popular posts from this blog