When I run these four commands on Xubuntu 16.04, either locally or over ssh, they all seem to do the exact same thing:
export DISPLAY=:0.0 #not necessary unless you have logged in over ssh instead of starting a terminal locally
gedit &
gedit & disown
nohup gedit
nohup gedit & disown
I don't get the the difference between gedit &
and gedit & disown
because if I kill the parent terminal or log out out of an ssh session, it would seem that gedit is "disowned" in either scenario.
As for two and three, the only difference I see is that the command output is logged to a separate file and will continue to be logged to that separate log even if the original shell session that spawned the bg process is killed.
As for three and four, I keep reading that there is a technical difference, but cannot understand at all why would you would prefer one over the other.
Which one should I use? I have seen all four commands used in tutorials and Q&As, and despite some really great answers describing the technical differences between nohup and disown, I can't seem to get a clear recommendation (except perhaps for logging purposes or shell compatibility) for which one I should use.