10 January, 2021

Ubuntu: How to open a browser window in a URL via Bash

"I want a fast way to open a browser in a specific URL from a folder.

Here is a solution in Bash. Create a file like this:

#!/bin/bash
# open url in chrome
xdg-open https://whateverURL.whot

Now save the file, as myURL.sh or similar. Remember to make the file executable:

# chmod a+x myURL.sh

Now you can run the file from your favorite terminal:

# ./myURL.sh

Works on: Linux / Ubuntu.

No comments: