split [ファイル管理コマンド]
split コマンド
ファイルを複数に分割するコマンドです。分割元ファイルはそのまま残ります。分割ファイル名は、指定文字列に”aa”、”ab”・・・となります。
# ls -l
合計 136172
-rw-r--r-- 1 root root 139160749 7月 3 16:19 yaruo_db.dump
# split -C 10m yaruo_db.dump yaruo_db.dump_spt-
# ls -l
合計 272392
-rw-r--r-- 1 root root 139160749 7月 3 16:19 yaruo_db.dump
-rw-r--r-- 1 root root 10485716 7月 3 16:25 yaruo_db.dump_spt-aa
-rw-r--r-- 1 root root 10485672 7月 3 16:25 yaruo_db.dump_spt-ab
-rw-r--r-- 1 root root 10485704 7月 3 16:25 yaruo_db.dump_spt-ac
-rw-r--r-- 1 root root 10485718 7月 3 16:25 yaruo_db.dump_spt-ad
-rw-r--r-- 1 root root 10485671 7月 3 16:25 yaruo_db.dump_spt-ae
-rw-r--r-- 1 root root 10485722 7月 3 16:25 yaruo_db.dump_spt-af
-rw-r--r-- 1 root root 10485698 7月 3 16:25 yaruo_db.dump_spt-ag
-rw-r--r-- 1 root root 10485677 7月 3 16:25 yaruo_db.dump_spt-ah
-rw-r--r-- 1 root root 10485706 7月 3 16:25 yaruo_db.dump_spt-ai
-rw-r--r-- 1 root root 10485694 7月 3 16:25 yaruo_db.dump_spt-aj
-rw-r--r-- 1 root root 10485698 7月 3 16:25 yaruo_db.dump_spt-ak
-rw-r--r-- 1 root root 10485677 7月 3 16:25 yaruo_db.dump_spt-al
-rw-r--r-- 1 root root 10485695 7月 3 16:25 yaruo_db.dump_spt-am
-rw-r--r-- 1 root root 2846701 7月 3 16:25 yaruo_db.dump_spt-an
- -l オプションは、指定した行数分ずつファイルを分割します
- -b オプションは、指定したバイト数ずつファイルを分割します
- -C バイト数:指定したバイト数を超えない範囲でファイルを分割します
# cat yaruo_db.dump_spt* >> yaruo_db.dump_new
結合するときはこんな感じですかね・・・。
| 固定リンク
「LINUX コマンド」カテゴリの記事
- やる夫がログローテーションの時間を変更するようです。(2009.01.21)
- egrep [ファイル管理コマンド] (2008.08.05)
- Linux コマンド リファレンス(2008.03.05)
- watch [プロセス管理コマンド] (2008.07.01)
- やる夫がアカウント管理をするようです。(2008.02.14)

コメント