Linux vertical truncation tool cut

Source: Internet
Author: User

The cut Command refers to a text truncation tool that can read content from a linux File or standard input and vertically intercept the required information columns. Cut can help us cut out the required information items, so that we can analyze the data on the server, simplify the data when the system is excluded, reduce work costs, and improve work efficiency! In addition to cut, the awk, sed, and sort commands can also be used to intercept data.

Format of cut:

Cut OPTION + [FILE] text or information to be output

Common options include:

-D: Used as the separator for cutting. The default value is space,

-F: which items are selected for output? For example, f1 indicates the first item to be cut out,

For example, it is the information of the first 10 users in/etc/passwd.

If you only want to extract the user name and the user's home directory information, you can use head/etc/passwd | cut-d:-f1, 6

-D: indicates to use the colon as the separator,-f1, 6 indicates to be separated, and then select 1st columns and 6th columns for output

Linux cut usage

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.