LX0-104 · Question #1
What output will the following command produce? seq 1 5 20
The correct answer is A. 1. The seq command generates numbers in a sequence based on a start, increment, and end value. For seq 1 5 20, the command starts at 1, increments by 5, and generates numbers up to 20.
Question
Options
- A1
- B1
- C1
- D2
- E5
How the community answered
(51 responses)- A94% (48)
- B2% (1)
- E4% (2)
Why each option
The `seq` command generates numbers in a sequence based on a start, increment, and end value. For `seq 1 5 20`, the command starts at 1, increments by 5, and generates numbers up to 20.
The `seq` command with `FIRST INCREMENT LAST` syntax generates a sequence starting at FIRST, incrementing by INCREMENT, and stopping when the next number would exceed LAST. For `seq 1 5 20`, the numbers generated are 1, 6, 11, and 16, with 1 being the first value.
This choice is identical to the correct choice 'A', implying the same correct technical reason.
This choice is identical to the correct choice 'A', implying the same correct technical reason.
The `seq` command's first argument specifies the starting number, which is 1, not 2.
The `seq` command's first argument specifies the starting number, which is 1, not 5, and 5 is the increment value, not the start.
Concept tested: Linux seq command usage
Source: https://www.man7.org/linux/man-pages/man1/seq.1.html
Topics
Community Discussion
No community discussion yet for this question.