VGM
VGM

Reputation: 69

Control output when split a large text file in pieces

I would need your help about how can I control the output when I split a large text file in pieces.

For exemple, in this moment when I run the command

split -l 2000 file newfile-

The current output is

newfile-aa
newfile-ab
etc

What I would like to have, if is possible

newfile-000
newfile-001
newfile-002

Thanks for your help.

Upvotes: 0

Views: 53

Answers (1)

Rob
Rob

Reputation: 351

Use

split -l 2000 -a 3 -d file newfile-

The -a 3 sets the suffix to 3 characters.

The -d uses numeric suffixes.

Upvotes: 2

Related Questions