Read from APUE, just feel curious:
The password file is used every time a user logs in to a UNIX system and every time someone executes an
ls -lcommand.
Read from APUE, just feel curious:
The password file is used every time a user logs in to a UNIX system and every time someone executes an
ls -lcommand.
The file-system directly associates the numerical UID (User ID) and GID (Group ID) values with the file, not the user name and group name (which are strings). So the ls -l command (and any other command that displays the user and group owner of a file) need to get the user and group names from somewhere. The /etc/passwd file is one such source (probably the original and most common source). The manual bears this out - from PASSWD (5) (i.e. the man page for the /etc/passwd file):
many utilities, like ls(1) use it to map user IDs to usernames