nerdexam
CompTIA

LX0-103 · Question #194

What is the default action of the split command on an input file?

The correct answer is B. It will break the file into new files of 1,000 line pieces each.. By default, the split command divides an input file into output files of 1,000 lines each, using a line-count-based split rather than a byte-size-based one.

GNU and Unix Commands

Question

What is the default action of the split command on an input file?

Options

  • AIt will break the file into new files of 1,024 byte pieces each.
  • BIt will break the file into new files of 1,000 line pieces each.
  • CIt will break the file into new files of 1,024 kilobyte pieces each.
  • DIt will break the file into new files that are no more than 5% of the size of the original file.

How the community answered

(41 responses)
  • B
    93% (38)
  • C
    5% (2)
  • D
    2% (1)

Why each option

By default, the split command divides an input file into output files of 1,000 lines each, using a line-count-based split rather than a byte-size-based one.

AIt will break the file into new files of 1,024 byte pieces each.

1,024 bytes per piece is not the default; you must explicitly specify byte-based splitting with the -b option.

BIt will break the file into new files of 1,000 line pieces each.Correct

When invoked without options, split uses a default of 1,000 lines per output file (-l 1000). Each output file is named with a prefix (default 'x') followed by a two-letter suffix (xaa, xab, etc.), and the line-based split is the standard default behavior defined in POSIX.

CIt will break the file into new files of 1,024 kilobyte pieces each.

1,024 kilobyte pieces require explicitly passing '-b 1024k'; this is not the default behavior.

DIt will break the file into new files that are no more than 5% of the size of the original file.

The split command has no concept of a percentage-based file size; it splits by line count or explicit byte size.

Concept tested: Linux split command default line-based file splitting

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

Topics

#split command#file splitting#line count

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice