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.
More Articles by Tony Lawrence © 2011-07-07 Tony Lawrence
While modern technology has given people powerful new communication tools, it apparently can do nothing to alter the fact that many people have nothing useful to say. (Leo Gomes)