l852018751 发表于 2022-11-8 15:32
sort target -t ',' -k 3.5
HOH 发表于 2022-11-8 17:59
但凡你man一下都不会发这个帖子,3列第5字符
ttyang 发表于 2022-11-8 18:10
谢谢,水王
你的linux技术很厉害,见识过的
Sort keys can be specified using the options:
-k keydef The keydef argument is a restricted sort key field definition. The format of
this definition is:
field_start[type][,field_end[type]]
where field_start and field_end define a key field restricted to a portion of
the line (see the EXTENDED DESCRIPTION section), and type is one or more
modifiers from the list of characters 'b', 'd', 'f', 'i', 'n', 'r'. The 'b'
modifier shall behave like the -b option, but shall apply only to the
field_start or field_end to which it is attached. The other modifiers shall
behave like the corresponding options, but shall apply only to the key field to
which they are attached; they shall have this effect if specified with
field_start, field_end, or both. If any modifier is attached to a field_start or
to a field_end, no option shall apply to either. Implementations shall support
at least nine occurrences of the -k option, which shall be significant in
command line order. If no -k option is specified, a default sort key of the
entire line shall be used.
When there are multiple key fields, later keys shall be compared only after all
earlier keys compare equal. Except when the -u option is specified, lines that
otherwise compare equal shall be ordered as if none of the options -d, -f, -i,
-n, or -k were present (but with -r still in effect, if it was specified) and
with all bytes in the lines significant to the comparison. The order in which
lines that still compare equal are written is unspecified.
HOH 发表于 2022-11-8 18:27
你这不叫man好吧,这个才叫man
ttyang 发表于 2022-11-8 18:38
啊,咋这么欺负人,我的Ubuntu 20.04.4 LTS
运行
man sort
欢迎光临 全球主机交流论坛 (https://ddzzz.eu.org/) | Powered by Discuz! X3.4 |