I think the key here is based on this statement:
For instance, if I run top & ; disown, top quits when I quit Terminal. I want to keep top alive.
The moment you quit Terminal, it immediately kills whatever you were running. This is where terminal multiplexers come into play.
The solution to this is to use tmux.
tmux is a "terminal multiplexer" but one of the best features about it is that it continues running even if you close Terminal.
From their man
page:
tmux is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.
So, if you want to launch top
, you could detach from it while it continued in the background even if Terminal is quit.
tmux is available through homeberew and MacPorts.
- HomeBrew:
sudo brew install tmux
- MacPorts:
sudo port install tmux
Detailed installation info can be found on their respective sites.
As for using tmux
, just launch Terminal and execute tmux
. You will get a Terminal screen with a green bar.

Execute (for example)top
.

Quit and relaunch Terminal.
To get a list of sessions:
tmux list-sessions
0: 1 windows (created Wed Sep 7 18:13:21 2016) [132x24]
Attach to that specific session
tmux attach -t0
And the session comes back up.

top
was just an example command. I would use a different command that doesn't output anything.