#!/usr/bin/env bash # first 3 lines seq 1 20 | head -n 3 # last 3 lines seq 1 20 | tail -n 3
first and last N lines