There are a lot of refinements you could make but I think the first one would be to make use of
awk's ability to use patterns for field separators. If colons don't show up anywhere else, then you could do it like this:
Code:
awk -F '[ :]' '{print $1}'
Otherwise, you'll just have to trim the first field of any punctuation:
Code:
awk '{ sub(/[[:punct:]]/, "", $1); print $1 }'
Eventually you'll be able to put the equivalent of
grep and
tail in there too. But one change at a time for now.