Operating System - HP-UX
1837967 Members
3758 Online
110124 Solutions
New Discussion

Split one large file into 2 smaller files

 
Samo_2
Occasional Advisor

Split one large file into 2 smaller files

Hi,
I would like to split one large file in to at least to smaller files (1.8Gb to 2x900Mb).
Thanks
Samo
6 REPLIES 6
twang
Honored Contributor

Re: Split one large file into 2 smaller files

What is the file format?
Pete Randall
Outstanding Contributor

Re: Split one large file into 2 smaller files

man split


Pete

Pete
Evert Jan van Ramselaar
Valued Contributor

Re: Split one large file into 2 smaller files

If it's a text file, you might want to look at the 'split' command.
Contrary to popular belief, Unix is userfriendly. It just happens to be selective about who it makes friends with.
Ollie R
Respected Contributor

Re: Split one large file into 2 smaller files

Hi Samo,

By what? Number of chars? Complete lines?

Is it text?

What is the overall purpose of this?

Ollie.
To err is human but to not award points is unforgivable
Claudio Cilloni
Honored Contributor

Re: Split one large file into 2 smaller files

If you think that a raw way to split is good for you, you can use the split command:

$ split -b 900m

that create two files, xaa and xab.
these two files could be joined so:

$ cat xaa xab >newfile

where 'newfile' is exactly equal the original.

the man page of 'split' could give you more
details

Bye
Claudio
Dario_1
Trusted Contributor

Re: Split one large file into 2 smaller files

Samo:

Use the split command. See the man pages for more details.

Regards,

Dario