Count specific column values

Hi all:
quick question!

I have the following data that resembles some thing like this:

i	am	tired
tired	am	i
what	is	up
hello	people	cool

I want to count (or at least isolate) all of the unique elements in the 2nd column.

I have tried this:

cut -f 2 | uniq 'input'

which does not work.
Any help/suggestions on how to solve the problem?

Try :

You need to sort it before using uniq

$ cut -f2 file | sort | uniq

following gives you count of occurrence

$ cut -f2 file | sort | uniq -c

In GNU sort, use -u option:

cut -f2 file | sort -u

Hello,

Following may also help.

awk '!a[$2]++ {print $2}' file_name

Output will be as follows.

am
is
people

Thanks,
R. Singh