Is there a way to open the default browser on a user's system to a specific page from within a Bash script, or other-language script?


Best guess is xdg-open it should automatically fall-back to your Desktop environment to determine the browser.

  • Does this then allow the script to terminate, and still execute the command to open the default browser? – Thomas Ward Jul 30 '12 at 17:29
  • Did you mean "open the URL in background"? You can append & at the end of the command to tell it to execute in the background. For example xdg-open http://unix.stackexchange.com/questions/44311 &. In this case it's unnecessary because xdg-open opens the URL in the background by default. – phunehehe Jul 30 '12 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.