I am simulating the default behavior of
ps without arguments:
One selection condition is to find processes with controlling terminal being the same as the one of the current shell.
The other selection condition is to find processes with euid as the current user.
So I need to logically AND the selections by user and terminal.
$ ps -u t -t /dev/pts/4 -o pid,tname,time,ucmd $ ps -u t -t pts/4 -o pid,tname,time,ucmd $ ps -u t -t /dev/tty -o pid,tname,time,ucmd
I know the controlling terminal of the current shell is
But all give me processes with other controlling terminals and without controlling terminals. Thanks.