그러한 파일이 많고 메모리 소비가 가장 높은 것이 무엇인지 알고 싶습니다(Mem).
$ cat utg006012l-racon-2.fasta.o5230935
[racon::Polisher::initialize] loaded target sequences 0.013133 s
[racon::Polisher::initialize] loaded sequences 6.667809 s
[racon::Polisher::initialize] loaded overlaps 6.267742 s
[racon::Polisher::initialize] aligning overlaps [=> ] 8.633518 s^M[racon::Polisher::initialize] aligning overlaps [==> ] 9.058757 s^M[racon::Polisher::initialize] aligning overlaps [===> ] 9.490215 s^M[racon::Polisher::initialize] aligning overlaps [====> ] 9.760396 s^M[racon::Polisher::initialize] aligning overlaps [=====> ] 10.008019 s^M[racon::Polisher::initialize] aligning overlaps [======> ] 10.332580 s^M[racon::Polisher::initialize] aligning overlaps [=======> ] 10.681680 s^M[racon::Polisher::initialize] aligning overlaps [========> ] 11.022209 s^M[racon::Polisher::initialize] aligning overlaps [=========> ] 11.350026 s^M[racon::Polisher::initialize] aligning overlaps [==========> ] 11.675731 s^M[racon::Polisher::initialize] aligning overlaps [===========> ] 12.004713 s^M[racon::Polisher::initialize] aligning overlaps [============> ] 12.330591 s^M[racon::Polisher::initialize] aligning overlaps [=============> ] 12.650907 s^M[racon::Polisher::initialize] aligning overlaps [==============> ] 12.965631 s^M[racon::Polisher::initialize] aligning overlaps [===============> ] 13.271211 s^M[racon::Polisher::initialize] aligning overlaps [================> ] 13.553430 s^M[racon::Polisher::initialize] aligning overlaps [=================> ] 13.825148 s^M[racon::Polisher::initialize] aligning overlaps [==================> ] 14.088558 s^M[racon::Polisher::initialize] aligning overlaps [===================>] 14.350089 s^M[racon::Polisher::initialize] aligning overlaps [====================] 14.598578 s
[racon::Polisher::initialize] transformed data into windows 0.542441 s
[racon::Polisher::polish] generated consensus 11154.363114 s
[racon::Polisher::] total = 11183.003787 s
-----
PBS Job 5230935.pbs
CPU time : 03:05:52
Wall time : 03:06:38
Mem usage : 4960216kb
사용했지만 grep "Mem" *-racon-2.fasta.o* | cut -d':' -f3 | sed 's|kb||'| sed 's|b||' |awk '{print $1}' | sort
출력이 정렬되지 않았습니다.
582384
5832
5832
584004
584552
584928
585008
585144
585416
586164
586252
587792
588196
588852
589204
58992
590336
590704
591184
592112
5928
5932
593700
59420
59476
595128
595696
596356
5968
59696
597772
599356
59972
6012
60300
6032
60404
604240
60528
6064
606544
607448
608080
내가 놓친 게 무엇입니까?
미리 감사드립니다
답변1
cut -d':' -f3
:
행에서 세 번째로 구분된 필드를 추출 하지만 이를 적용하는 행은 다음과 같습니다.
Mem usage : 4960216kb
즉, 필드가 두 개만 있습니다.
Mem usage
, 그리고4960216kb
.
긴 파이프를 피하려면 다음을 사용할 수 있습니다.
sed -n '/^Mem/s/[^[:digit:]]*//gp' *-racon-2.fasta.o* | sort -n
이는 단일 sed
호출을 사용하여 문자열로 시작하는 줄을 추출 Mem
하고 숫자가 아닌 줄의 모든 항목을 제거하여 숫자를 자릅니다. 그런 다음 추출된 숫자를 전달하여 sort -n
숫자로 정렬합니다.
이는 다음과 같습니다.
grep '^Mem' *-racon-2.fasta.o* | tr -d -c '[:digit:]\n' | sort -n