Get the first column of a file in bash


awk '{print $1}' someFile

*NOTE: If you want the second column change $1 to $2 etc. $1 can be replaced by a variable and used in a more elaborate way that applies to more cases/problems.

Advertisements

This post is also available in: Greek

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.