LoginSignup
21
26

More than 5 years have passed since last update.

ファイルを分割して結合する方法

Posted at

数百MB~の大容量ファイルをファイル転送する場合、どうしても問題が出る問題ケースがあります。
最近では減りましたが、未だに存在します。

その場合、spiltcat を使いましょう。下手なツールを使わず、コマンドでだけでいけます。
Windows でも minttyとか導入すれば可能です。私はそれでやっています。

ファイルの分割 - Windows (約100Mずつ)

$ split -b 100000000 bigdata.zip bigdata.zip.
$ cat bigdata.zip.* > bigdata.zip 
$ ls -al
-rw-r--r-- 1 BIGUSER Administrators 100000000 Apr  7 13:38 bigdata.zip.aa
-rw-r--r-- 1 BIGUSER Administrators 100000000 Apr  7 13:38 bigdata.zip.ab
-rw-r--r-- 1 BIGUSER Administrators 100000000 Apr  7 13:38 bigdata.zip.ac
-rw-r--r-- 1 BIGUSER Administrators 100000000 Apr  7 13:38 bigdata.zip.ad
-rw-r--r-- 1 BIGUSER Administrators 100000000 Apr  7 13:39 bigdata.zip.ae
-rw-r--r-- 1 BIGUSER Administrators 100000000 Apr  7 13:39 bigdata.zip.af
-rw-r--r-- 1 BIGUSER Administrators  56026876 Apr  7 13:39 bigdata.zip.ag

転送

ファイルの結合 - Linux

$ ls -al
-rw-r--r--. 1 smalluser users 100000000 2015-04-07 13:41 bigdata.zip.ab
-rw-r--r--. 1 smalluser users 100000000 2015-04-07 13:42 bigdata.zip.ac
-rw-r--r--. 1 smalluser users 100000000 2015-04-07 13:42 bigdata.zip.ad
-rw-r--r--. 1 smalluser users 100000000 2015-04-07 13:43 bigdata.zip.ae
-rw-r--r--. 1 smalluser users 100000000 2015-04-07 13:43 bigdata.zip.af
-rw-r--r--. 1 smalluser users  56026876 2015-04-07 13:44 bigdata.zip.ag
$ cat bigdata.zip.* > bigdata.zip 
$ ls -l bigdata.zip
-rw-r--r--. 1 smalluser users 656026876 2015-04-07 13:47 bigdata.zip

良きLinux Lifeを

21
26
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21
26