Have you ever want to split a large file into several small files?
I’ve face this problem few days ago. I need to split a large file (3GB
log file) into several smaller file where i can read it using normal
text editor.
To split large file into several smaller files, you can use split command in linux. Just follow the steps below and you will be able to split large file into smaller files.
To restore the original file, you can use cat command.
To join all the smaller file to restore the original file type:-
To split large file into several smaller files, you can use split command in linux. Just follow the steps below and you will be able to split large file into smaller files.
-
in your shell key in
$ split –bytes=1m /path/to/large/file
/path/to/output/file/prefix - Done. You just split your large file into several smaller files
To restore the original file, you can use cat command.
To join all the smaller file to restore the original file type:-
$ cat prefix* > NEWFILENAME
I recently ran into an issue where I had about 7.5 GB of files split
into 512M chunks downloaded from linux machine. The files had been
generated using the split command:split -b 512m files.tgzThis created the following files:
-rw-rw-rw- 1 user group 536870912 Mar 9 20:44 xaaI wanted to combine them in windows and looked around for a while until I realized you can use Microsoft’s copy utility in binary mode!
-rw-rw-rw- 1 user group 536870912 Mar 9 20:46 xab
-rw-rw-rw- 1 user group 536870912 Mar 9 20:49 xac
copy /b xa* files.tgz /bNow I’m all done! Hurray for built-in utilities.
Комментариев нет:
Отправить комментарий