dd role is to convert and copy files, we can use it to separate files, the associated options are as follows:
IF = filename: the input file name
of = finename: output file name
bs = bytes: Number of bytes to read and write, the default is 512bytes
skip = blocks: pre copy, a skipped block before blocks of the input file, determines the size of the block has bs
count = blocks: blocks only the first copy of the block of the input file
, for example, there is now a file file, the word size is 116616 section:
[root] # du -b file
116 616 file
divide it into two files file1 and file2, then we set to 1024 bytes per block, the file placed before 60 file1, remaining into file2:
[ the root] # = file dd IF COUNT = 1024 BS = Skip 60 = = 0 of file1
[the root] # = file dd IF COUNT = 1024 BS = Skip = 60 = 60 of file2
and then merge the two files cat to file. bak, pay attention to the order of the file:
[root] # CAT file1 file2> file.bak
can use the md5sum verify file and file.bak:
[root] # md5sum file
3ff53f7c30421ace632eefff36148a70 file
[root] # md5sum file.bak
3ff53f7c30421ace632eefff36148a70 file.bak
same time can prove two files.
Under Linux split, merge files --dd and cat
Guess you like
Origin blog.csdn.net/u014426028/article/details/97937594
Recommended
Ranking