LFCS practice question 15 of 35
What output will the command seq 10 produce?
Full set: 260 questionsThe seq command is a standard utility for printing a sequence of numbers to standard output. When invoked with a single argument, LAST, it defaults to a starting value of 1 and an increment of 1. Therefore, seq 10 will print the sequence of numbers from 1 up to and including 10. By default, each number in the sequence is separated by a newline character, resulting in one number per line.
A. A continuous stream of numbers increasing in increments of 10 until stopped: seq produces a finite sequence and the default increment is 1, not 10.
C. The numbers 0 through 9 with one number per line: The default starting number for seq is 1, not 0.
D. The number 10 to standard output: seq prints the entire sequence from the starting number to the final number, not just the final number.
- GNU Coreutils Manual, Section 20.1 "seq: Print a sequence of numbers". The documentation states, "Print numbers from FIRST to LAST, in steps of INCREMENT. If FIRST is omitted, it defaults to 1. ... If only one argument is given, seq prints all numbers from 1 to that number."
- man seq page from the Linux man-pages project. The synopsis seq [OPTION]... LAST and seq [OPTION]... FIRST LAST confirms that a single argument is interpreted as the last number in a sequence starting from 1.
Keep practicing
Take the free LFCS practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other LFCS practice questions
- Question 1Which of the following commands should be added to /etc/bash_profile in order to change t…
- Question 2Which of the following commands reboots the system when using SysV init? (Choose TWO corr…
- Question 3Which of the following tasks can be accomplished using the command date? (Choose TWO corr…
- Question 4Which of the following environment variables overrides or extends the list of directories…
- Question 5Which of the following are syslog facilities? (Choose TWO correct answers.)
- Question 6Which of the following programs uses the hosts.allow file to perform its main task of che…
