Identify the home-directory field in a record using /etc/passwd format.
app01:x:2100:2100:Application User:/srv/apps/app01:/bin/bashWhich field number is the home directory?
/etc/passwd fields are name, password placeholder, UID, GID, GECOS, home, and shell. Home is field 6.
Detailed explanation
Incorrect. Field 3 is the numeric UID.
Incorrect. Field 4 is the primary GID.
Incorrect. Field 5 is the GECOS/comment field.
Correct. Field 6 contains the home path.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'app01:x:2100:2100:Application User:/srv/apps/app01:/bin/bash' | cut -d: -f6Expected result
/srv/apps/app01Key points
- Fields use colons
- Home is field 6
- Shell is field 7
Notes
- Environment: POSIX cut / 一時標準入力のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Account record
Identity attributes such as a user ID, home directory, and login shell.
Group membership
Primary and supplementary groups used during permission checks.
Password aging
State and time limits that control password changes and account access.