1
The simplest solution would be: nohup xdg-open file.pdf && exit nohup causes the xdg-open command to run ignoring SIGHUP, so if the terminal is closed it has no effect on the xdg-open command. && indicates the next command will be run if the previous command is successful i.e. returns the exi...