LFCS · Question #794
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 new files, with each new file containing 1,000 lines from the original.
Question
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
(31 responses)- B94% (29)
- C3% (1)
- D3% (1)
Why each option
By default, the `split` command divides an input file into new files, with each new file containing 1,000 lines from the original.
While `split` can divide by bytes, the default is 1,000 lines, not 1,024 byte pieces (which requires the `-b 1K` option).
When no options are specified, the `split` command's default behavior is to break the input file into pieces, where each output file contains 1,000 lines.
Dividing by 1,024 kilobyte pieces (`split -b 1M`) is a custom option, not the default line-based splitting.
There is no default behavior in `split` to divide files based on a percentage of the original file size.
Concept tested: split command default behavior
Source: https://www.gnu.org/software/coreutils/manual/html_node/split-invocation.html
Topics
Community Discussion
No community discussion yet for this question.