Skip to content

Instantly share code, notes, and snippets.

@MattMS
Last active March 10, 2017 12:30
Show Gist options
  • Save MattMS/006ed0951e69ce281f4c2df4b2631cfa to your computer and use it in GitHub Desktop.
Save MattMS/006ed0951e69ce281f4c2df4b2631cfa to your computer and use it in GitHub Desktop.
Print the second column (space-delimited) of a file.
# Given my_file containing first line of "my_id my_value", this will print "my_value".
cat ./my_file | sed -En '1{s/^(\S+)\s+(.*)$/\2/g ; p}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment