首页  

linux sort 命令     所属分类 linux 浏览量 243
sort -t , -k 2 -r  b.txt
分隔符 逗号  ,第二列 字典逆序  

默认 第一列 字典序
-n 数值


cat a.txt
1
3
7
8
22
11

sort a.txt

1
11
22
3
7
8

sort  -n a.txt

1
3
7
8
11
22

cat b.txt

1,a
3,b
7,c
8,d
22,e
11,f

sort -t , b.txt
sort -t , -n  b.txt


sort -t , -k 2 -r  b.txt
分隔符 逗号  ,第二列 字典逆序  
11,f
22,e
8,d
7,c
3,b
1,a


java线程数统计 
jstack 7363|grep java.lang.Thread.State: -c
 
线程各种状态统计
jstack 7363|grep java.lang.Thread.State: |sort|uniq -c

     34    java.lang.Thread.State: RUNNABLE
      3    java.lang.Thread.State: TIMED_WAITING (on object monitor)
      8    java.lang.Thread.State: TIMED_WAITING (parking)
      9    java.lang.Thread.State: TIMED_WAITING (sleeping)
      2    java.lang.Thread.State: WAITING (on object monitor)
     73    java.lang.Thread.State: WAITING (parking)

第一列作为数字降序排序

jstack 7363|grep java.lang.Thread.State: |sort|uniq -c|sort -rn -k 1


     75    java.lang.Thread.State: WAITING (parking)
     34    java.lang.Thread.State: RUNNABLE
      9    java.lang.Thread.State: TIMED_WAITING (sleeping)
      8    java.lang.Thread.State: TIMED_WAITING (parking)
      3    java.lang.Thread.State: TIMED_WAITING (on object monitor)
      2    java.lang.Thread.State: WAITING (on object monitor)

上一篇     下一篇
clickhouse存储层与计算层

zookeeper集群搭建

互联网广告术语解释

Java黑科技VirtualMachine

Spring JMX

JVM Attach机制