Hello people, I'm having a problem with regex in using the command sh cute, the problem is that I want to show all processes that start with g and just show the command, but do not know, help me please?
To do this I use the command:
ps aux | grep g
but this show all process who contains the letter g and i need who start with g and cut the command to get this, for example i get a output of ps
root 1012 0.0 0.0 6128 644 tty4 Ss+ 16:10 0:00 /sbin/getty -8 38400 tty4
1000 4571 0.0 0.0 12724 868 pts/4 S+ 19:21 0:00 grep --color=auto g
And I need get only /sbin/getty because is in path and the command grep. In definite get all files start with g and cut and cut above so that it is the command and attributes PD: I need use to get all with the commands grep and cut, and i can't don't use the pgrep.
Thanks in advance