Wednesday, May 1, 2024
10
rated 0 times [  10] [ 0]  / answers: 1 / hits: 6876  / 1 Year ago, tue, may 23, 2023, 11:49:26

When I'm saying something like



curl http://example.com/123


and I want to read only n first lines, how do I do that? I know that's something like:



curl http://example.com/123 | ??? 

More From » command-line

 Answers
3

The command you're looking for is head -n D where D can be any integer number. Example:



curl http://example.com/123 | head -n 3

[#29182] Thursday, May 25, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
feeous

Total Points: 102
Total Questions: 122
Total Answers: 119

Location: Netherlands
Member since Thu, Jul 1, 2021
3 Years ago
;