split:分割文件
简介split命令可以根据指定的行数或者指定的文件大小分割文件
说明
split命令可以根据指定的行数或者指定的文件大小分割文件
格式
split [option] [filename] [PREFIX]
PREFIX:输出文件名前缀
常用参数说明
- -b:指定分割后文件的最大字节数
- -l:指定分割后文件的最大行数
- -a:指定后缀长度,默认为2个字母
- -d:使用数字后缀
示例
1、指定行数进行分割
[root@localhost ~]# wc -l /apps/nginx/conf/nginx.conf
123 /apps/nginx/conf/nginx.conf
[root@localhost ~]# split -l 30 /apps/nginx/conf/nginx.conf nginx_
[root@localhost ~]# ll nginx_*
-rw-r--r--. 1 root root 619 Jun 4 01:24 nginx_aa
-rw-r--r--. 1 root root 670 Jun 4 01:24 nginx_ab
-rw-r--r--. 1 root root 990 Jun 4 01:24 nginx_ac
-rw-r--r--. 1 root root 677 Jun 4 01:24 nginx_ad
-rw-r--r--. 1 root root 10 Jun 4 01:24 nginx_ae
[root@localhost ~]# wc l nginx_*
wc: l: No such file or directory
30 50 619 nginx_aa
30 64 670 nginx_ab
30 87 990 nginx_ac
30 69 677 nginx_ad
3 2 10 nginx_ae
123 272 2966 total
2、指定后缀长度
[root@localhost ~]# split -l 30 -a 3 /apps/nginx/conf/nginx.conf nginx_
[root@localhost ~]# ll nginx_*
-rw-r--r--. 1 root root 619 Jun 4 01:27 nginx_aaa
-rw-r--r--. 1 root root 670 Jun 4 01:27 nginx_aab
-rw-r--r--. 1 root root 990 Jun 4 01:27 nginx_aac
-rw-r--r--. 1 root root 677 Jun 4 01:27 nginx_aad
-rw-r--r--. 1 root root 10 Jun 4 01:27 nginx_aae
[root@localhost ~]# wc l nginx_*
wc: l: No such file or directory
30 50 619 nginx_aaa
30 64 670 nginx_aab
30 87 990 nginx_aac
30 69 677 nginx_aad
3 2 10 nginx_aae
123 272 2966 total
3、使用数字后缀
[root@localhost ~]# split -l 30 -a 3 -d /apps/nginx/conf/nginx.conf nginx_
[root@localhost ~]# ll nginx_*
-rw-r--r--. 1 root root 619 Jun 4 01:27 nginx_000
-rw-r--r--. 1 root root 670 Jun 4 01:27 nginx_001
-rw-r--r--. 1 root root 990 Jun 4 01:27 nginx_002
-rw-r--r--. 1 root root 677 Jun 4 01:27 nginx_003
-rw-r--r--. 1 root root 10 Jun 4 01:27 nginx_004
[root@localhost ~]# wc l nginx_*
wc: l: No such file or directory
30 50 619 nginx_000
30 64 670 nginx_001
30 87 990 nginx_002
30 69 677 nginx_003
3 2 10 nginx_004
123 272 2966 total
4、按大小分割文件
[root@localhost ~]# split -b 1K -d /apps/nginx/conf/nginx.conf nginx_ #1kb分割
[root@localhost ~]# ll nginx_*
-rw-r--r--. 1 root root 1024 Jun 4 01:29 nginx_00
-rw-r--r--. 1 root root 1024 Jun 4 01:29 nginx_01
-rw-r--r--. 1 root root 918 Jun 4 01:29 nginx_02
在使用Laravel中如果要进行复杂的查询,那么通过模型中的函数来查询是不行的,所以本文主要记录如何通过aggregate来进行复杂的查询。
网页扫描二维码库:Html5-Qrcode,官网地址:https://scanapp.org/html5-qrcode-docs/
本文主要记录Nginx中的fastcgi_param的参数记录。
现在使用最为广泛的DNS服务器软件是BIND(Berkeley Internet Name Domain),最早有伯克利大学的一名学生编写,现在最新的版本是9,有ISC(Internet Systems Consortium)编写和维护。
通过泛域名证书配置时,申请的域名泛域名证书,在三级域名上为什么一直报证书有误
快速生成表格
Electron页面跳转、浏览器打开链接和打开新窗口
在使用Git的过程中,不想每次都输入用户名和密码去拉取代码,所以就需要保存这些信息,那么既然有保存了,就必须有清除功能。
在Mac电脑中,如何对Git的用户名和密码进行修改呢?起初不懂Mac,所以整了很久,本文将记录如何对这个进行操作,以便后期使用。
Docker编译镜像出现:fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.12/main: temporary error (try again later)
WARNING: Ignoring APKINDEX.2c4ac24e.tar.gz: No such file or directory问题