I am running the command: ps -ef | grep [p]ts/1
The result is:
root 13820 1733 0 14:19 ? 00:00:00 sshd: root@pts/1
root 13822 13820 0 14:19 pts/1 00:00:00 -bash
root 15847 13822 0 15:32 pts/1 00:00:00 ps -ef
root 15848 13822 0 15:32 pts/1 00:00:00 grep [p]ts/1
Why is it returning grep
and ps
?
P.S. Single and double quotes give me the same results. I am able get output without "grep" using grep -v grep
works, but I want to use more elegant way.