1

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: awk `{print $1 “:” $6}` /etc/passwd

Make the most of this question

This page focuses on one Linux MCQs question from Programming. After checking the answer, return to the topic list to practice more or run a timed set.

Linux MCQs MCQ: 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” | Extra Education