get all line except n last one
with head -n <negative number>
we can get the output except n lines
example
will gives as the content of a.txt except the last one
Let say we have file 1 2 3 4 5, and with grep we want to only get 1 2 3.
we can achive this with ls and grep
the -B show 100000000 lines before matched line, and the head -n -1 removes the matched
Last updated