How can I use the ‘head’ and ‘tail’ commands with piping to display only lines 2 and 3 from my selected file 'imaginaryfile' (which has 10 lines)?
What I've tried so far:
>$ head -n 3 imaginaryfile | tail -n 2 > > (head -n 1) > > (tail -n 1)
The output for line 3 comes, but I didn't get an output of line 2. What can I do to correct this and get an output of line 2 and line3?