I need some help with grep and uniq
I've been trying to figure out a few things with grep and uniq but I'm really stuck now and would really need some help.
1. I'm trying to grep anything that starts with an "a", but doesn't have any more "a":s. Which means that grep would show me words like "and", but not words like "america".
2. I'm trying to grep anything that doesn't contain "a" at all. I know it's easily done by using "grep -v a". However, I'm trying to do this without using "-v". I've tried things like "grep [^a]", but that would only remove things that contain "a" only. I've tried using * and .* but it doesn't help me at all.
3. I have a file containing two rows of words, and it looks something like this:
Now, what I want to do is to sort out all words that are the same, but have different word classes. So 'cat', 'dog' and 'eat' should be sorted out since both are nouns, Which means I want the output to be:
I've tried using uniq and sort in every way i could think of, but I still can't sort this out. There's a TAB between the words, if the cut command could be of any help.
Help is very appreciated!!