Shell programming cut, shellcut

Source: Internet
Author: User

Shell programming cut, shellcut
Cut refers to the unit of action in the file. Based on the conditions you set, part of the content is cut and printed out. Output to standard output, not saved to any file

-B Range: determined by byte range-c range: determined by character range-f range: determined by set field range. By default, the field is split by TAB. Use-d to specify.
The range is set to n-bit cut content. -N: Cut the content of 1-n bits. N-cut the content of n-last bit. N-m cut the content of n-m bit
-D': 'specifies the delimiter. -S only prints rows with delimiters. -- Out = delimiter = string specifies the delimiter output, which can be used to format the output.
The difference between-B and-c is the difference between characters and bytes. Bytes are the smallest unit stored in the computer. Character is an independent unit in the encoding. For example, a Chinese character or punctuation in the Chinese character code, or a letter or punctuation in the acⅱ code. Therefore, a single character may contain one or more bytes. That's the relationship.
Example: cut-d': '-f 2-3-s/etc/passwd

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.