Suppose I open a file (pdf) with a command line in Ubuntu by running
The pdf is shown in a pdf reader which is set as default.
Now how can I close this pdf viewer from the command line in Ubuntu?
fuser -k -TERM FILE
FILEwith the name of the file in question.
Check the link below for a fuller description (and be aware this is a powerful/ dangerous command)
Source: Is there something like an “xdg-close” - opposite of xdg-open? on Unix & Linux