zoukankan      html  css  js  c++  java
  • Linux split命令

    Linux split命令用于将一个文件分割成数个。

    该指令将大文件分割成较小的文件,在默认情况下将按照每1000行切割成一个小文件。

    语法

    split [--help][--version][-<行数>][-b <字节>][-C <字节>][-l <行数>][要切割的文件][输出文件名]

    参数说明

    • -<行数> : 指定每多少行切成一个小文件
    • -b<字节> : 指定每多少字节切成一个小文件
    • --help : 在线帮助
    • --version : 显示版本信息
    • -C<字节> : 与参数"-b"相似,但是在切 割时将尽量维持每行的完整性
    • [输出文件名] : 设置切割后文件的前置文件名, split会自动在前置文件名后再加上编号

    实例

    [root@iZbp143t3oxhfc3ar7jey0Z /]# cp /etc/passwd /tmp/
    [root@iZbp143t3oxhfc3ar7jey0Z /]# cd /tmp
    [root@iZbp143t3oxhfc3ar7jey0Z 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
    [root@iZbp143t3oxhfc3ar7jey0Z 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
    [root@iZbp143t3oxhfc3ar7jey0Z 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]#
  • 相关阅读:
    python内置函数枚举 enumerate()
    python内置函数map的介绍
    什么是lambda函数
    python urllib库 加密及解析url中中文汉字
    python解决高并发思路
    后端文件保存的两种方式
    matplotlib基本用法
    自编码器
    数据增强
    卷积神经网络
  • 原文地址:https://www.cnblogs.com/dalianpai/p/12399115.html
Copyright © 2011-2022 走看看