I'm trying to extract the process numbers starting with the number 3.
When using ps | sed "/^\s\+3/"
, I get an error message : sed: -e expression #1, char 8: missing command
I then added a global flag : ps | sed "/^\s+3/g"
which succeeds but instead of showing me all matches, it removes all the matches found.
This is the unchanged output :
PID TTY TIME CMD
3128 pts/8 00:00:00 bash
5279 pts/8 00:00:00 ps
5280 pts/8 00:00:00 sed
In the end, this is the output I get : PID TTY TIME CMD
5219 pts/8 00:00:00 ps
5220 pts/8 00:00:00 sed