User Tools

Site Tools


bash:files:split_big_files

BASH - Files - Split big files

To split big files, the split command can be used.

For example to split a 400MB file named bigfile into 100MB chunk files named smallfile0*

split -b 100M -d --verbose bigfile smallfile
 
creating file 'smallfile00'
creating file 'smallfile01'
creating file 'smallfile02'
creating file 'smallfile03'

where:

  • -b is for byte size.
  • -d is for numeric suffixes.
  • smallfile is the prefix to be used.

The output is:

ls
 
bigfile smallfile00 smallfile01 smallfile02 smallfile03

To recover back the splitted files into a file named newbigfile:

cat smallfile0* > newbigfile
bash/files/split_big_files.txt · Last modified: 2022/06/13 11:37 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki