GeorgeTH 2020-03-02
Linux split命令用于将一个文件分割成数个。
该指令将大文件分割成较小的文件,在默认情况下将按照每1000行切割成一个小文件。
split [--help][--version][-<行数>][-b <字节>][-C <字节>][-l <行数>][要切割的文件][输出文件名]
参数说明:
[ /]# cp /etc/passwd /tmp/ [ /]# cd /tmp [ tmp]# ll total 8 srwxrwxrwx 1 mysql mysql 0 Feb 17 21:46 mysql.sock -rw-r--r-- 1 root root 1062 Mar 2 23:49 passwd drwx------ 3 root root 4096 Feb 17 21:35 systemd-private-0f5d31a91df74a67b5634765e6737ef3-chronyd.service-fIQB6P [root@iZbp143t3oxhfc3ar7jey0Z tmp]# split -10 passwd [ tmp]# ll total 20 srwxrwxrwx 1 mysql mysql 0 Feb 17 21:46 mysql.sock -rw-r--r-- 1 root root 1062 Mar 2 23:49 passwd drwx------ 3 root root 4096 Feb 17 21:35 systemd-private-0f5d31a91df74a67b5634765e6737ef3-chronyd.service-fIQB6P -rw-r--r-- 1 root root 385 Mar 2 23:50 xaa -rw-r--r-- 1 root root 497 Mar 2 23:50 xab -rw-r--r-- 1 root root 180 Mar 2 23:50 xac [root@iZbp143t3oxhfc3ar7jey0Z tmp]# split -b300 passwd [ tmp]# ll total 24 srwxrwxrwx 1 mysql mysql 0 Feb 17 21:46 mysql.sock -rw-r--r-- 1 root root 1062 Mar 2 23:49 passwd drwx------ 3 root root 4096 Feb 17 21:35 systemd-private-0f5d31a91df74a67b5634765e6737ef3-chronyd.service-fIQB6P -rw-r--r-- 1 root root 300 Mar 2 23:50 xaa -rw-r--r-- 1 root root 300 Mar 2 23:50 xab -rw-r--r-- 1 root root 300 Mar 2 23:50 xac -rw-r--r-- 1 root root 162 Mar 2 23:50 xad [root@iZbp143t3oxhfc3ar7jey0Z tmp]#