If you redirect the nohup application as:nohup bash -c printf \command\n\ &> /dev/nullThe nohup.out file is not created, however the terminal I ran the command also do not get any output. How to keep the terminal output from the command but not create the nohup.out file?
How to not create the nohup.out file, but keep the terminal output?
terminal;io redirection;background process;output;nohup
Try this,To get the STDOUT and STDERR both on console and in a nohup.out file, execute the following before executing your nohup command.exec >  >(awk '{ print $0; fflush();}' | tee -a nohup.out)exec 2>  >(awk '{ print $0; fflush();}' | tee -a nohup.out >&2)nohup bash -c printf \command\n\ &EDIT:If you want the nohup.out to not be created, then try thisexec >  >(awk '{ print $0; fflush();}')exec 2>  >(awk '{ print $0; fflush();}')nohup bash -c printf \command\n\ &This will not create the nohup.out while displaying STDOUT and STDERR on the console.Put the above lines in a script and then run it in the background.