At work, I am often asked to find commands that meet specific needs. One of them recurs: how to make selections of lines in a file?
The question is very simple, some of you have got the answer. But when you’re not a “frequent terminal user” you can realize that it’s not as simple.
There are 4 commands to use:
head: get firsts lines of a file tail: get last lines of a file cat: get the whole content of a file sed: to manipulate specific lines “head” and “tail” commands have got an option to get a specific number of lines: “-n”