The split command in Linux system is mainly used for file splitting. It is often used when dealing with large files. The following small series will introduce you to CentOS how to use split command to split files. Let's get to know it.
In Linux, there may be a little not pay attention to a huge volume of log files, even hundreds of M, dragged down analysis is a waste of time, this time, if the file can be cut N small files, you can see the most recent log with the last file.
There are some means, such as using the shell to generate logs every day, etc., but not the scope of this discussion.
The commands for cutting large files in CentOS are as follows:
The code is as follows:
split [OPTION] [INPUT [PREFIX]]
The options are as follows: Br>
•-a : Specify the length of the suffix
•-b : How many bytes per file
•-d : Use a numeric suffix instead of a letter
•-l : Specify the number of lines per file
For example, the system home Xiaobian wants the suffix length to be 2, which is -a 2. Use the numeric suffix -d. 10M per file, ie -b 10m. The command can be designed as follows:
The code is as follows:
split -a 2 -d -b 10m /var/lib/mysql/general.log nowamagic
will be in /root The following cut file is generated under the folder:
The code is as follows:
nowamagic00
nowamagic01
nowamagic02
nowamagic03
nowamagic04
nowamagic05
nowamagic06
nowamagic07
nowamagic08
nowamagic09
except for the last file is not 10M (It may be just 10M, but the chances are small), the others are.
The above is how CentOS uses the split command to split files. If you want to move a large file, or if the analyzed log is large, you can try splitting with the split command.
Linux rights management is a professional knowledge, there are many ways to manage Linux permissions
Under the Linux system, the font of the Chrome browser can be rendered, which makes
The ping command is a command for network diagnosis in Linux system. It can check whether the networ
to change the program icon Unity is a desktop environment interface, mainly used for Ubuntu system,
The basic process of setting serial port properties in Linux system
Linux svn error Cant convert string from how to do?
How to upgrade Docker in Ubuntu system
How to use commands to transfer files between Mac and Linux
Ubuntu 12.04 via XRDP Remote Desktop Method
How to compile and install Mono notes in Linux system
Linux system uses logrotate to cut Tomcat logs
How to install the whois command on the CentOS system
How to achieve multi-threaded programming under Linux shell
Linux to create file or directory soft links, hard link skills
Windows 7 system is the most secure operating system ever.
Win7 system opens the webpage prompt application has been blocked by JAVA security
Windows 7 hard disk installation method Daquan
Win7 upgrade Win10 error code 0xC1900101-0x30017 solution
U disk loading system [graphic details] super detailed tutorial XP version (a)
Win7 can't connect to broadband prompt error code 1717 processing solution
How does Win10 manually check whether the reported error report has been resolved?
How can I shut down regularly?
Win10 cpu high occupancy how to do win10 cpu high occupancy solution