Home > AIX, Commands, commands, Linux > Linux – Break file into smaller files. Put file back together again.

Linux – Break file into smaller files. Put file back together again.

If for instance you were wanting to break a large file down so that it can be written to a CD you can use the split command with the -bytes flag.

split [option] [input] [output]

For example you wish to break a 10G file into 10 files of 1G size:

$ split -bytes=1G /path/to/large/file /path/to/output/file/prefix

or

$ split -b1G /path/to/large/file /path/to/output/file/prefix

To put the file back together you need to cat the files back together:

$ cat prefix* > newfilename

Further Reading

http://linux.about.com/library/cmd/blcmdl1_split.htm
http://linux.die.net/man/1/split

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: