In the process of system O & M, log files are often very large. In this case, we need to split the log files. Here, we use shell scripts to split the files :#! /Bin/bash
Done
Here, httperr8007.log is the big file you want to split. File _ $ file. log is the split file, and file_1.log, file_2.log, file_3.log ......, Each split file contains only 1000 lines (you can set the parameters yourself). Method 2: Split parameter:
-B: the size of the file to be split. The unit can be added, for example, B, K, and M;
-L: split by the number of lines; # split by 1000 lines of each file except for the split-l 1000 httperr8007.log httperr httpaa, httpab, httpac ........ # split the split-B 100 k According to KB of each file. httperr8007.log HTTP httpaa, httpab, httpac ........
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.