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