QuestionQ85

VerifiedGNU and Unix Commands

Which command prints the usernames (first column) and their primary group (fourth column) from the /etc/passwd file?

Explanation

cut extracts specified delimiter-separated fields. With -d : -f 1,4, it uses the colon delimiter in /etc/passwd and outputs fields 1 and 4: the username and primary group ID field.

Community Discussion

No comments yet. Be the first to start the discussion!