Interview Questions

There are seven fields in the /etc/passwd file. Which of the following lists all the fields in the correct order?

Operating System Interview Questions and Answers


(Continued from previous question...)

There are seven fields in the /etc/passwd file. Which of the following lists all the fields in the correct order?

There are seven fields in the /etc/passwd file. Which of the following lists all the fields in the correct order?
Choose one:
a. username, UID, GID, home directory, command, comment
b. username, UID, GID, comment, home directory, command
c. UID, username, GID, home directory, comment, command
d. username, UID, group name, GID, home directory, comment


Answer: b
The seven fields required for each line in the /etc/passwd file are username, UID, GID, comment, home directory, command. Each of these fields must be separated by a colon even if they are empty.

(Continued on next question...)

Other Interview Questions