I know there are lots of questions about it but i cantI can't get it working.
I want to clean a group (for instance rootroot) in /etc/group/etc/group with sedsed or awkawk. So iI need to delete everything after "root:*:0:"root:*:0:
I tried to remove it with:
cat /etc/group | awk '!p;/^root:*:0:/{p=1}'
cat /etc/group | awk '!p;/^root:*:0:/{p=1}' and
cat /etc/group | sed 's/root\:\*\:0\:.*//'
cat /etc/group | sed 's/root\:\*\:0\:.*//'
but sed removes the whole root line.
What am i doing wrong?