nerdexam
Linux_Foundation

LFCS · Question #1

What output will the following command produce? seq 1 5 20

The correct answer is A. 1. The seq command with three arguments generates a sequence of numbers starting from the first argument, incrementing by the second argument, and stopping at or before the third argument.

Submitted by rachelw· Apr 18, 2026Essential Commands

Question

What output will the following command produce? seq 1 5 20

Options

  • A1
  • B1
  • C1
  • D2
  • E5

How the community answered

(32 responses)
  • A
    88% (28)
  • C
    6% (2)
  • D
    3% (1)
  • E
    3% (1)

Why each option

The `seq` command with three arguments generates a sequence of numbers starting from the first argument, incrementing by the second argument, and stopping at or before the third argument.

A1Correct

The command `seq 1 5 20` starts the sequence at 1, increments each subsequent number by 5, and generates numbers up to a maximum of 20. Therefore, the first number produced in this sequence is 1.

B1
C1
D2

Option D suggests the sequence starts with 2, but the `seq` command explicitly defines the starting number as the first argument, which is 1.

E5

Option E suggests the sequence starts with 5, but 5 in the `seq 1 5 20` command represents the increment value, not the starting value.

Concept tested: Linux `seq` command syntax

Source: https://www.gnu.org/software/coreutils/manual/html_node/seq-invocation.html

Topics

#seq command#command line utilities#sequence generation

Community Discussion

No community discussion yet for this question.

Full LFCS Practice