Linux Cut Command Detailed

Source: Internet
Author: User

Cut is a command for cutting files, simply fetching columns

Cut common Command parameters
-B,--bytes=list Select only these bytes-c,--characters=list Select only these characters-d,--delimiter=del  IM use DELIM instead of the TAB for field delimiter-f,--fields=list select only these fields;  Also print any line that contains no delimiter character, unless the -S option is specified-n with-b: Don ' t split multibyte characters--complement Comple ment the set of selected bytes, characters or fields-s,--only-delimited do not print line                            s not containing delimiters--output-delimiter=string use STRING as the output delimiter The default is to use the input delimiter--help display this help and exit--version output version inform ation and exit
Common Command Display

Set a specific cut character to take a specific column

Cut-d '/'-f3 logs.txt    set/For the cut character-   F denotes the first column, where the third column is taken

Find a specific number of characters

Replace content within file: Source file is not affected

TR ' var ' log ' < logs_bak.txt| Head-3

Linux Cut Command Detailed

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: 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.