how to open url in linux by command line
Introduction
Working from the command line or the terminal can not be avoided if we want to streamline tasks or if we want to implement any sort of automation. In automation, we may need to open a browser to a specific URL or retrieve data from an end point. Opening a browser from the terminal can be easily performed on major operating systems. In this short code snippets post, we are going to summarize that…
Linux
On Linux, the xdc-open command opens a file or URL using the default application. To open a URL using the default browser…
1 |
xdg-open https://www.8bitavenue.com |
Mac OS
On Mac, we can use the open command to open a file or a URL using the default application. We can also specify what application to open the file or URL. Take a look at the following examples..
1 |
open -a "Safari" ttp://www.8bitavenue.com |
or
1 |
open https://www.8bitavenue.com |
Windows
On Windows, the start command is used to open files or launch a browser. Here is an example…
1 |
start https://www.8bitavenue.com |
Unix
On all Unix based operating systems, we can also use the wget and curl commands. The following command retrieves the HTML file Unlike the browser, it only downloads the file without renderingā¦
1 |
wget https://www.8bitavenue.com |
Similarly, we can use the curl command to the do the sameā¦
1 |
curl https://www.8bitavenue.com |
If you are curious about the difference between wget and curl, check the following article.
References
Thanks for visiting.
About Author
Mohammed Abualrob
Software Engineer @ Cisco
epic
Thank you for your article and all these valuable information. In case you know, is there a way to open a wanted url inside a browser tab, by typing a command line, which should simulate the click on a html link? For example, like clicking at your website url, inside Google search page. I am generally in search for this automation