You can use wc to quickly check the line counts after splitting. SomeLogFile.log xab xad xaf xah xaj xal xan xap xar If you use the ls command, you can see multiple new files in your directory. Let’s split the sample log file: split someLogFile.log The letters that follow enumerate the files therefore xaa comes first, then xab, and so on. If no prefix is specified, it will use ‘x’. Split files into multiple filesīy default, split command creates new files for each 1000 lines. Let’s see how to use it to split files in Linux. This is the syntax of the Split command: split filename I advise you to have a quick look at the wc command to understand the output of the split command examples. I will use the ll and wc commands to highlight file changes. ![]() Note that I will not directly display output in these examples because of the large file sizes. You can download a copy of this file from the GitHub link. To help you learn about the split command I am using a relatively large text file containing 17170 lines and 1.4 MB in size.
0 Comments
Leave a Reply. |