04-19 18:26:55.605 22750 22883 W System.err: java.lang.NoSuchFieldException
04-19 18:26:55.605 22750 22883 W System.err: at com.xiaomi.push.au.a(Unknown Source:16)04-19 18:26:55.605 22750 22883 W System.err: at com.xiaomi.push.au.a(Unknown Source:4)04-19 18:26:55.605 22750 22883 W System.err: at com.xiaomi.push.service.z.a(Unknown Source:880)04-19 18:26:55.605 22750 22883 W System.err: at com.xiaomi.push.service.z.a(Unknown Source:188)04-19 18:26:55.605 22750 22883 W System.err: at com.xiaomi.push.service.p.a(Unknown Source:821)04-19 18:26:55.605 22750 22883 W System.err: at com.xiaomi.push.service.p.a(Unknown Source:605)04-19 18:26:55.605 22750 22883 W System.err: at com.xiaomi.push.service.p.a(Unknown Source:11)04-19 18:26:55.605 22750 22883 W System.err: at com.xiaomi.push.service.d.a(Unknown Source:46)04-19 18:26:55.605 22750 22883 W System.err: at com.xiaomi.push.service.ak.b(Unknown Source:50)04-19 18:26:55.605 22750 22883 W System.err: at com.xiaomi.push.service.ak.a(Unknown Source:10)04-19 18:26:55.605 22750 22883 W System.err: at com.xiaomi.push.service.XMPushService$c.a(Unknown Source:8)04-19 18:26:55.605 22750 22883 W System.err: at com.xiaomi.push.service.XMPushService$i.run(Unknown Source:37)04-19 18:26:55.605 22750 22883 W System.err: at com.xiaomi.push.service.g$c.run(Unknown Source:175)04-19 18:27:24.787 23660 23685 W System.err: load vdr indoor lib success.
使用cut 我们可以实现删除上面的冗余信息
123456789101112131415
adb logcat | grep "System.err" --line-buffered | cut -d " " -f 6-
System.err: java.lang.NoSuchFieldException
System.err: at com.xiaomi.push.au.a(Unknown Source:16)System.err: at com.xiaomi.push.au.a(Unknown Source:4)System.err: at com.xiaomi.push.service.z.a(Unknown Source:880)System.err: at com.xiaomi.push.service.z.a(Unknown Source:188)System.err: at com.xiaomi.push.service.p.a(Unknown Source:821)System.err: at com.xiaomi.push.service.p.a(Unknown Source:605)System.err: at com.xiaomi.push.service.p.a(Unknown Source:11)System.err: at com.xiaomi.push.service.d.a(Unknown Source:46)System.err: at com.xiaomi.push.service.ak.b(Unknown Source:50)System.err: at com.xiaomi.push.service.ak.a(Unknown Source:10)System.err: at com.xiaomi.push.service.XMPushService$c.a(Unknown Source:8)System.err: at com.xiaomi.push.service.XMPushService$i.run(Unknown Source:37)System.err: at com.xiaomi.push.service.g$c.run(Unknown Source:175)
按照字节切分(cut -b)
按照字节位置切分
1234567891011121314
# 取第一个字节pi@raspberrypi:~ $ echo"abcdef" | cut -b 1
a
# 取第二个字节pi@raspberrypi:~ $ echo"abcdef" | cut -b 2
b
# 从1开始,0会报错pi@raspberrypi:~ $ echo"abcdef" | cut -b 0
cut: byte/character positions are numbered from 1
Try 'cut --help'for more information.