Skip to content

Instantly share code, notes, and snippets.

@garethrees
Created September 20, 2017 08:18
Show Gist options
  • Select an option

  • Save garethrees/6b7c4b81346797f5e72fa51d20ac0dff to your computer and use it in GitHub Desktop.

Select an option

Save garethrees/6b7c4b81346797f5e72fa51d20ac0dff to your computer and use it in GitHub Desktop.
Sed & Awk Examples
# Print column 1
awk '{print $1}' FILE
# Print column 1 and 2, separated by '/'
awk '{print $1 "/" $2}' FILE
# Print line 1 and 5
sed -n -e 1p -e 5p FILE
@garethrees
Copy link
Copy Markdown
Author

@garethrees
Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment