LFCS · Question #279
Which of the following outputs will the below command produce? seq 1 5 20
The correct answer is A. 1. The seq 1 5 20 command generates a sequence of numbers starting at 1, incrementing by 5, and stopping before exceeding 20.
Question
Options
- A1
- B1
- C1
- D2
- E5
How the community answered
(47 responses)- A70% (33)
- B9% (4)
- C4% (2)
- D2% (1)
- E15% (7)
Why each option
The `seq 1 5 20` command generates a sequence of numbers starting at 1, incrementing by 5, and stopping before exceeding 20.
The `seq FIRST INCREMENT LAST` command generates numbers starting from `FIRST` (1), incrementing by `INCREMENT` (5), up to `LAST` (20). The first number in this sequence is 1.
The output includes more numbers than just '1', but '1' is the correct starting point.
The output includes more numbers than just '1', but '1' is the correct starting point.
The number 2 is not generated by this command; the sequence starts at 1 and increments by 5.
The number 5 is not generated by this command; the sequence starts at 1 and increments by 5.
Concept tested: seq command usage
Source: https://man7.org/linux/man-pages/man1/seq.1.html
Topics
Community Discussion
No community discussion yet for this question.