Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I have tab-demlimted file, I want to sort them only for red_ball as follows


id      tagid    name
HH556   EN76     red_ball
JH678   EN45     green_ball
MH678   CV67     red_ball
TY896   RT56     red_ball



id  tagid
HH556   EN76
MH678   CV67
TY896   RT56
share|improve this question

1 Answer 1

up vote 1 down vote accepted
  printf 'Red_ball\nid\ttagid\n\n'
  awk -F'\t'  'NR>1 && $3 == "red_ball" {print $1 "\t" $2}' < input.txt |
} > output.txt
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.