Site icon Bytefreaks.net

Get the first column of a file in bash

Advertisements

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.

Exit mobile version