Question
Three linux problems Below is a two-column report showing the number (first column) of each different group-id (second column) from the /etc/passwd file. Use a
Three linux problems
Below is a two-column report showing the number (first column) of each different group-id (second column) from the /etc/passwd file. Use a pipe of cut/sort/uniq to re-create this output. Some man page perusing may be required!
$
5 0 1 1 1 2 1 4 1 7 1 12 1 13 1 14 1 16 1 23 1 27 1 28 1 29 1 30 1 32 1 37 1 38 1 42 1 43 1 47 1 48 1 50 1 51 1 67 1 68 1 69 1 70 1 74 1 77 1 81 1 86 1 94 1 97 1 99 2 100 74 411 2 412 1860 511 . . .
From your home directory, use egrep/cut/sort to produce a list showing the username and real name of all the students in the /etc/passwd file; the list should be lexicographically sorted by username. Copy/paste just your command for hand-in.
023906973:Hobs Ryan Tomas 10608634:Yang Zhi 11159827:Chan Jonas . . . zrkerk:"Kerk Zi Rui" . zsj25502:Zeng Jero
3.
egrep -i "^(.*:){4} ?v.*:/home.*$" /etc/passwd
Rewrite it to make it as UN-complex as possible while still working! Hint: The solution uses just 3 characters with special meaning whereas the above solution uses ~13 (depending on how you count them!)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started