Wednesday, March 22, 2017

How to split large log files into smaller files in Linux.

If for instance you were wanting to break a large wso2carbon.log file down so that it can be read for analyzing, you could use the split command with the -bytes flag.

Command:

split [option] [input] [output]


For example you wish to break a 5GB file into files of 1G size (wso2carbon.log.2017-03-18) use below command.

split -b 1G -d wso2carbon.log.2017-03-18 carbonlog-part


Your split potions will be as below:

No comments:

Post a Comment