How to get the basic linux ps functionality in mac?

Solution 1:

I gather the concern is that the MacOS version of ps follows BSD conventions and displays all your processes associated with any controlling terminal. Linux ps follows System V/POSIX conventions and shows your processes on the current controlling terminal.

To replicate the POSIX behavior, just run ps -T.

Solution 2:

/bin/ps on macOS also provides the same style of output as your example for me.

$ sleep 100 &
[1] 22261
$ ps
  PID TTY           TIME CMD
22124 ttys000    0:00.14 bash
22261 ttys000    0:00.00 sleep 100
$

Check if you have any aliases set up (run \ps) and make sure it's /bin/ps that you're running.