How Do I Grep Multiple Fields in Unix?
Contents

How do I grep multiple files?

To search multiple files with the grep command, insert the filenames you want to search, separated with a space character. The terminal prints the name of every file that contains the matching lines, and the actual lines that include the required string of characters. You can append as many filenames as needed.

How do I grep to the second column?

3 Answers

  1. The -F, parameter specifies the delimiter, which is set to a comma for your data.
  2. $2 refers to the second column, which is what you want to match on.
  3. “ST” is the value you want to match.
Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest