Say you have a txt file, what is the command to view the top 10 lines and bottom 10 lines of file simultaneously?
i.e. if the file is 200 lines long, then view lines
Building on what @Samus_ explained here about how @Aleksandra Zalcman's command works, this variation is handy when you can't quickly spot where the tail begins without counting lines.
{ head; echo "####################\n...\n####################"; tail; } < file.txt
Or if you start working with something other than 20 lines, a line count might even help.
{ head -n 18; tail -n 14; } < file.txt | cat -n