I am trying to get the top five processes of a specific user in a bash:
ps -Ao user,uid,comm,pid,pcpu,tty --sort=-pcpu | head -n 6 | grep <username> However, this selects the top 5 processes across the system and then filters out the processes that belong to the specified username. I basically want to flip the logic. Get all processes of a specific user and then filter the top 5.
headand thegrep?