我正在尝试将输出通过管道传输ps -ax -o pid,lstart
到 an中awk
并使用它,或者尝试使用sort
.
的输出ps -ax -o pid,lstart
类似于:
PID STARTED
1 Tue Feb 4 23:10:00 2020
2 Tue Feb 4 23:10:00 2020
3 Tue Feb 4 23:10:00 2020
4 Tue Feb 4 23:10:00 2020
6 Tue Feb 4 23:10:00 2020
8 Tue Feb 4 23:10:00 2020
9 Tue Feb 4 23:10:00 2020
10 Tue Feb 4 23:10:00 2020
11 Tue Feb 4 23:10:00 2020
12 Tue Feb 4 23:10:00 2020
14 Tue Feb 4 23:10:00 2020
15 Tue Feb 4 23:10:00 2020
16 Tue Feb 4 23:10:00 2020
17 Tue Feb 4 23:10:00 2020
18 Tue Feb 4 23:10:00 2020
20 Tue Feb 4 23:10:00 2020
这使工作变得更加困难,因为我必须先按天排序,然后是一小时、一分钟和一秒……