Linux: shell base (Ix)

Character processing command

1, Sort order: sort 

  sort [options] filename

    Options:

    -f: ignore case

    -n: numeric be sorted (sort default string)

     -r: reverse sequencing

     -t: Specifies the separator (default delimiter is a tab)

    -kn [, m]: sorted according to fields specified range. Starting from n fields, m end of the field. (Default to the end of the line)

 

  sort -n -t ":" -k 3,3 / etc / passwd are sorted in the third field. (Where -n is specified in the numerical order, or will be shown in the case 2 after 11 and 12)

2, statistics command: wc

  wc [options] filename

  Options:

    -l: only count the number of rows

    -w: only count the number of words

    -m: only count the number of characters

 

Guess you like

Origin www.cnblogs.com/rtczza/p/11795584.html