Q. One of the entry of /etc/passwd file is shown below: user1:x:1111:2222:McqMate:/home/user1:/bin/bash Which among the following will print userid and home dir in the following pattern “user1:/home/user1”
β
Correct Answer: (A)
awk `{print $1 “:” $6}` /etc/passwd