Issue
I would like to change the headers name in the result of the ps aux command, specifically %CPU and %MEM, what I want is to delete the % symbol and just get CPU and MEN. Is there a way to get this directly in the command or in a bash script?
Thanks for your answers!
Solution
If you read man ps
and found, that your ps
does not offer such a functionality, pipe the output through sed
to search and replace all (s/.../.../g
) % by spaces in the first line (1
):
ps aux | sed '1s/%/ /g'
Answered By - Socowi Answer Checked By - Dawn Plyler (WPSolving Volunteer)