Given a text file of unknown length, how can I read, for example all but the first 2 lines of the file? I know tail will give me the last N lines, but
tail
I really don't know how to do it from just tail or head but with the help of wc -l (line count) and bash expression, you can achieve that.
wc -l
tail -$(( $( wc -l $FILE | grep -Eo '[0-9]+' ) - 2 )) $FILE
Hope this helps.