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...

xdg-open http://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..

open -a "Safari" ttp://www.8bitavenue.com

or

open http://www.8bitavenue.com

Windows

On Windows, the start command is used to open files or launch a browser. Here is an example...

start http://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…

wget http://www.8bitavenue.com

Similarly, we can use the curl command to the do the same…

curl http://www.8bitavenue.com

If you are curious about the difference between wget and curl, check the following article.

References

Thanks for visiting.

Leave a Reply