In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the "CentOS file division and merge commands", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "CentOS file division and merge commands" bar!
The syntax of the split command is:
Split [--help] [--version] [- a] [- b] [- C] [- l] [file to be cut] [output file name prefix]
The corresponding parameters are described as follows:
-a,-- suffix length used by suffix-length=N (default is 2)-b,-- bytes=SIZE byte size per output file-C,-- line-bytes=SIZE maximum byte size per line of each output file-d,-- numeric-suffixes uses numeric suffix instead of letter suffix-l,-- lines=NUMBER sets the number of lines per output file-- help displays help-- version displays version information.
Here are a few examples:
1) the file splitTest.txt is divided into multiple files, and the size of each file is 10m. Command:
$split-b 20m splitTest.txt $ls splitTest.txt xaa xab xac
2) the file splitTest.txt is divided into multiple files, and the size of each file is 10m. Specify the split file prefix bit split, command:
$split-b 20m splitTest.txt split $ls splitaa splitab splitac splitTest.txt
3) split the file splitTest.txt into multiple files, each with 500000 lines. Command:
$wc-l splitTest.txt 1502216 splitTest.txt $split-l 500000 splitTest.txt split $ls splitaa splitab splitac splitad splitTest.txt
4) split the file splitTest.txt into multiple files, each with 500000 lines. Specify that the suffix of the split file is a number and the number of digits is 3 digits, and the command:
$wc-l splitTest.txt 1502216 splitTest.txt $split-l 500000-d-a 3 splitTest.txt split $ls split000 split001 split002 split003 splitTest.txt
You can use the cat command to merge the split file into a new file:
$cat split0* > original.txt
Thank you for your reading, the above is the content of the "CentOS file division and merge command", after the study of this article, I believe you have a deeper understanding of the CentOS file division and merge command this problem, the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.