Let's say if my text file contains:
101 Adam 201 Clarie 502 Adam 403 Tom
and i want to write a command in the shell to only give me the numbers based of a specific name. For example, only output the number for the name 'Adam' would give:
I was thinking of something like:
cut -f 1 Data_1 | grep "Adam"
but it doesn't work. Data_1 is the filename. 1 refers to the first column. I'm new to Unix so I'll appreciate some feedback on this.