Skip to content

Instantly share code, notes, and snippets.

@mLuby
Created February 4, 2020 16:52
Show Gist options
  • Save mLuby/2ce9cd69e9a8548604e1a458199e8952 to your computer and use it in GitHub Desktop.
Save mLuby/2ce9cd69e9a8548604e1a458199e8952 to your computer and use it in GitHub Desktop.
Exclude first and last lines of example.txt just using tail and pipe in bash.
tail -n +2 example.txt | tail -r | tail -n +2 | tail -r
# -n +2 means all but 1 line at the end (+1 does include last line)
# -r means reverse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment