Shell command usage

Source: Internet
Author: User

Recently, I started to get started with some shell commands because of compiling some files. It seems amazing and the usage is quite large. So I made some notes and the command sequence may be messy, the function is not fully functional.

 

1. Cut command

The cut command is used to intercept a certain segment of a character, which is very reliable,The cut command has five parameters, including-C,-B, and-F, which indicate the truncation methods of "character", "Byte", and "field" respectively. Can only one of the three interception methods be used?

Here are two usage examples:

(1): Echo Hello, world | cut-C 8-12. In this usage, the truncation is based on the character position.-Specify the range of characters to intercept after C.

(2): Echo Hello, world | cut-F 1-d ',',-d Indicates 'delimiter ', that is, the separator, for example, in this example, it can be ''(Space), ',' (comma), and the number after-F indicates the part of the parts separated by delimiters.

 

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.