I was trying using head
command, in macOS using zsh, code below,
a.txt:
1
2
3
4
5
6
7
8
9
10
tail -n +5 a.txt // line 5 to line end
tail -n -5 a.txt // last line 5 to line end
head -n +5 a.txt // line 1 to line 5
head -n -5 a.txt // # What did this do?
The last command shows an error.
head: illegal line count -- -5
What did head -n -5 actually do?
man head
should answer all your questions. – Scroungehead
manual page? – Utherman head
on a Mac does not show any information at all, and althoughinfo head
does, it still shows valid negative-n
flag, which isn't supported by the macOs. So the question is valid and the answer is not in the manual :) – Disharoon