Breaks a file up into separate files, either by lines or bytes.
split -l1 /etc/passwd
will create a new file (xaa,xab, etc.) for each line of /etc/passwd.
Split is useful when you need to send a large file to someone whose isp enforces quotas on the size of mail files.
You can control the naming convention:
split -l 5000 bigfile foo.
will create 5000 line chunks named foo.aa, foo.ab etc. Some versions of split do that differently; check your man page.
To re-combine the files, use
cat foo.* > newbigfile
or, on a Windows machine,
copy FOO.* /B newbigfile /b
Got something to add? Send me email.
Increase ad revenue 50-250% with Ezoic
Inexpensive and informative Apple related e-books:
iOS 10: A Take Control Crash Course
Take Control of Upgrading to El Capitan
Take Control of the Mac Command Line with Terminal, Second Edition
Take Control of Upgrading to Sierra
El Capitan: A Take Control Crash Course