-1

As I've noticed, a command such as tail -n +5 a b prints its output in a format like this:

==>a<==

contents of a from line 5 to $EOF (including line 5)

==>b<==

contents of b from line 5 to $EOF (including line 5)

Is there a way (or perhaps another command) to print just the required contents from the specified line onwards? i.e.:

contents of a from line 5 to $EOF (including line 5)

contents of b from line 5 to $EOF (including line 5)
  • from line 5 including the 5th line? – RomanPerekhrest Nov 5 '17 at 16:11
3

Use the quiet option:

tail -q -n +5 a b
0

The file information is written to stderr, the real data is written to stdout (as both should be). So even if there was no -q option you could throw it away with

tail ... 2>/dev/null

And if you redirect the tail output then the file information will not be redirected anyway:

tail ... >output

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.