[Solaris Tip] Split Large Files

We have a very large core file and we need this to send to our vendor for analysis. The gzip’d file of the core is 20GB and the FTP server of the vendor does not like that. Therefore we need to split our very large file to smaller chunks that the FTP server would accept.

Based on the man pages – split(1)

NAME
split - split a file into pieces

SYNOPSIS
split [-linecount | -l linecount]  [-a suffixlength] [  file
[name]]

split [ -b  n | nk | nm] [-a suffixlength] [ file [name]]

DESCRIPTION
The split utility reads file and writes it in linecount-line
pieces  into  a  set  of output-files. The name of the first
output-file is name with aa appended, and so on lexicograph-
ically,  up  to  zz  (a  maximum  of 676 files). The maximum
length of  name  is  2  characters  less  than  the  maximum
filename  length  allowed by the filesystem.

Check on the file to send

[email protected]# ls -l
-rw-r-----   1 root     root     21474836480 Apr  8 10:33 core_files.tar.gz

Split the file into 200MB chunks

[email protected]# split -b 200m core_files.tar.gz core_files.tar.gz.split

List the generated files

[email protected]# ls -l
-rw-r-----   1 root     root    21474836480 Apr  8 10:33 core_files.tar.gz
-rw-r--r--   1 root     root    209715200 Apr  8 12:52 core_files.tar.gz.splitaa
-rw-r--r--   1 root     root    209715200 Apr  8 12:53 core_files.tar.gz.splitab
-rw-r--r--   1 root     root    209715200 Apr  8 12:53 core_files.tar.gz.splitac
-rw-r--r--   1 root     root    209715200 Apr  8 12:53 core_files.tar.gz.splitad
-rw-r--r--   1 root     root    209715200 Apr  8 12:53 core_files.tar.gz.splitae
-rw-r--r--   1 root     root    209715200 Apr  8 12:53 core_files.tar.gz.splitaf
<truncated>
-rw-r--r--   1 root     root    28265984 Apr  8 12:53 core_files.tar.gz.splitat

You will notice that split(1) has appended letters into the generated files to distinguish the hirearchy.


Readers who found this post were searching for:

  • solaris split
  • split solaris
  • solaris split file
  • solaris split command
  • split command in solaris
  • solaris split large file
  • split file solaris
  • solaris split command example
  • solaris 10 split command
  • unix gzip split file


Comments