LinuxShell command -- tr

Source: Internet
Author: User
The LinuxShell command -- trtr is used to convert characters from standard input to c or -- complerment to replace all characters not in the first character set. -D or -- delete all the first character set... linux Shell command -- tr is used to replace or delete all characters that are not in the first character set from the standard input for character conversion-c or -- complerment. -D or -- delete deletes all characters that belong to the first character set. -S or -- squeeze-repeats represents consecutive duplicate characters with a separate character. -T or -- the truncate-set1 first deletes the character tr that is longer than the second character set to replace the character from the standard input, delete and compress tr [options] set1 set2 set1 set2 is a character class, character set, the two are always equal digits, echo 12345 is automatically supplemented or discarded without waiting. | tr '0-9' '000000' 9876543210 implements encryption 87654, echo 87654 | tr '000000' 0-9 '9876543210 decrypts the delete character cat file.txt | tr-d 'set1' deletes the content of set1 echo 'who 100' | tr -d '0-9' who character set supplement tr-c [set1] [set2] echo hello 1 char 2 next 4 | tr-d-c '0-9 \ n' 1 2 4 compressed character tr-s [set1] convert multiple spaces into one space echo "gnu is not unix" | tr-s ''GNU IS NOT UNIX
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.