Linux cut by column

Source: Internet
Author: User
Linux splits cut by column to get data by column. for example, in the ps command, I want to get the UID column. Use ps | cut-c44-47. Shell code $ pspidppidpgidwinpidttyuidstimecommand5204...
Linux splits cut by column to get data by column. for example, in the ps command, I want to get the UID column. Use ps | cut-c 44-47. Shell code $ ps pid ppid pgid winpid tty uid stime command 5204 1 5204 con 5204 11:53:47/bin/sh 500 4716 5204 4716 con 2724 11:54:05/bin/ps www.2cto.com Shell code $ ps | cut-c 44-47 UID 500 500 500 cut has several common parameters, -c specifies the Start character position,-B specifies the start byte location, and-f specifies the start to split the node location. Cut -- help Sehll code $ cut -- help Usage: cut [OPTION]... [FILE]... print selected parts of lines from each FILE to standard output. -B, -- bytes = LIST output only these bytes-c, -- characters = LIST output only these characters-d, -- delimiter = DELIM use DELIM instead of TAB for field delimiter-f, -- fields = LIST output only these fields-n (ignored)-s, -- only-delimited do not print lines 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 information and exit www.2cto.com Use one, and only one of-B,-c or-f. each LIST is made up of one range, or specified ranges separated by commas. each range is one of: N 'th byte, character or field, counted from 1 N-from n' th byte, character or field, to end of line N-M from N 'th to M' th (sorted Ded) byte, character or field-M from first to M' th (sorted Ded) byte, character or field With no FILE, or when FILE is-, read standard input. report bugs .
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.