1. top 5 dùng nhiều CPU nhất:
$ ps xau | head -n1; ps xau | sort -nrk3 | head -n5ps xau để hiển thị các process đang chạy, head -n1 sẽ lấy dòng title để cho dễ nhìn,
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 28368 3.8 4.1 357208 41932 pts/4 Sl+ 14:02 0:23 /usr/bin/python /usr/bin/salt-master -ldebug
root 28744 1.8 5.4 523132 55292 pts/5 Sl+ 14:07 0:05 /usr/bin/python /usr/bin/salt-run state.orch orchestration.es -ldebug
root 28356 1.2 2.6 298472 27028 pts/4 Sl+ 14:02 0:07 /usr/bin/python /usr/bin/salt-master -ldebug
root 28801 1.0 3.3 372236 34168 ? S 14:07 0:02 /usr/bin/python /usr/bin/salt-cloud --profile ci-minion es7
root 28629 0.8 3.3 372980 34476 ? S 14:03 0:04 /usr/bin/python /usr/bin/salt-cloud --profile ci-minion es7
sort -nrk3 để sắp xếp theo kiểu số học (-n) từ lớn xuống nhỏ (-r) theo cột thứ 3 (-k cột %CPU)
head -n5 để lấy 5 kết quả đầu tiên.