Answer the question
In order to leave comments, you need to log in
How to display the last lines of several files in one command in Linux?
Good day to all.
Task: print the last 5 lines from several files.
I output like this:
tail -5 "/path/to/file1.ext" && tail -5 "/path/to/file2.ext" && tail -5 "/path/to/file3.ext"
Answer the question
In order to leave comments, you need to log in
tail -qn5 /path/to/file{1..3}.ext
if at all you need to ignore the error then:tail -qn5 /path/to/file{1..3}.ext 2>/dev/null
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question