Skip to content

Instantly share code, notes, and snippets.

@elhoyos
Created November 21, 2016 04:42
Show Gist options
  • Save elhoyos/e49ee9b3184759436f7af01dc21c46c3 to your computer and use it in GitHub Desktop.
Save elhoyos/e49ee9b3184759436f7af01dc21c46c3 to your computer and use it in GitHub Desktop.
cat a remote file and print first column only if matches
ssh host "cat file.log" | awk -v re="*" '$0 ~ re {print $1}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment