How to tail multiple files without empty lines?
Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
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)
text-processing tail
add a comment |Â
up vote
-1
down vote
favorite
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)
text-processing tail
from line 5 including the 5th line?
â RomanPerekhrest
Nov 5 '17 at 16:11
add a comment |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
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)
text-processing tail
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)
text-processing tail
edited Nov 5 '17 at 17:25
Hauke Laging
53.6k1282130
53.6k1282130
asked Nov 5 '17 at 15:58
Escu Esculescu
123
123
from line 5 including the 5th line?
â RomanPerekhrest
Nov 5 '17 at 16:11
add a comment |Â
from line 5 including the 5th line?
â RomanPerekhrest
Nov 5 '17 at 16:11
from line 5 including the 5th line?
â RomanPerekhrest
Nov 5 '17 at 16:11
from line 5 including the 5th line?
â RomanPerekhrest
Nov 5 '17 at 16:11
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
accepted
Use the quiet option:
tail -q -n +5 a b
add a comment |Â
up vote
0
down vote
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
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
Use the quiet option:
tail -q -n +5 a b
add a comment |Â
up vote
3
down vote
accepted
Use the quiet option:
tail -q -n +5 a b
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Use the quiet option:
tail -q -n +5 a b
Use the quiet option:
tail -q -n +5 a b
answered Nov 5 '17 at 16:17
Stephen Kitt
144k22312377
144k22312377
add a comment |Â
add a comment |Â
up vote
0
down vote
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
add a comment |Â
up vote
0
down vote
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
add a comment |Â
up vote
0
down vote
up vote
0
down vote
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
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
answered Nov 5 '17 at 17:28
Hauke Laging
53.6k1282130
53.6k1282130
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f402673%2fhow-to-tail-multiple-files-without-empty-lines%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
from line 5 including the 5th line?
â RomanPerekhrest
Nov 5 '17 at 16:11