Shell Primer-tr replacement character and split cut large file

Source: Internet
Author: User

Command: TR

Description: Replace character

Format TR ' original character ' new character ' can be range character, specified character

Command: Split

Option:-B 50m 1.txt According to the size of the split unit is b without units, units are trillion plus m

-L 1.txt divided by row number

Description: Cut large files, source files will not disappear,

[[email protected] ~]# ls *.txt
1.txt [2345].txt 2.txt 999.txt c.txt D.txt
[[email protected] ~]# ls *.txt |tr ' A-Z ' A-Z '////replace the A-Z in the file of LS into a-Z range replacement
1.TXT
[2345]. Txt
2.TXT
999.TXT
C.TXT
D.TXT

[[email protected] ~]# ls *.txt |tr ' CD ' CA '///C and D in the file of LS to replace C and a respectively
1.txt
[2345].txt
2.txt
999.txt
C.txt
A.txt

////////////////////////////////////////////////////////////////////////////////

Split

-L

[[email protected] home]# ls
Anaconda-ks.cfg
[[email protected] home]# wc-l anaconda-ks.cfg////line number 33
Anaconda-ks.cfg
[Email protected] home]# split-l anaconda-ks.cfg
[[email protected] home]# ls
Anaconda-ks.cfg Xaa xab xac xad

[[email protected] home]# wc-l x*////Line Count
Ten XAA
Ten Xab
Ten Xac
3 Xad
33 Total Dosage

-B

[[email protected] home]# DU-SB anaconda-ks.cfg////size 956b
956 Anaconda-ks.cfg
[Email protected] home]# Split-b anaconda-ks.cfg
[[email protected] home]# ls
Anaconda-ks.cfg Xaa xab xac xad
[Email protected] home]# du-sb xa? The same size
Xaa
Xab
Xac
Xad

Customizing new file names

[Email protected] home]# split-b anaconda-ks.cfg new_
[[email protected] home]# ls
Anaconda-ks.cfg new_aa new_ab new_ac new_ad xaa xab xac xad

//////////////////////////////////////////////////////////////////////////////////////////

Summary: TR ' original character ' new character '///split-l behavior Unit-B size unit

Shell Primer-tr replacement character and split cut large file

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.