Sunday, May 5, 2024
10
rated 0 times [  10] [ 0]  / answers: 1 / hits: 6877  / 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
feeous questions
Sat, Jul 23, 22, 23:21, 2 Years ago
Mon, Jul 5, 21, 19:59, 3 Years ago
Mon, Aug 16, 21, 11:42, 3 Years ago
Sun, Mar 19, 23, 21:03, 1 Year ago
;