たとえば、名前付きパイプからのデータを分析したい:
cat trace_pipe | awk '{print $6}' | head -100000 | sort | uniq -c |
sort -k 1 -nr
このコマンドは、 から最初の 100k 行のデータを収集しtrace_pipe
ます。限られた数の行ではなく、10 秒間データを収集する方法はありますか?
コマンドを使用できますが、
timeout
コマンドを分割する必要がある場合があります
timeout 10 cat trace_pipe > trace_pipe.cut
awk '{print $6}' trace_pipe.cut | sort | uniq -c | sort -k 1 -nr