Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am configuring hotkeys for commands and want a way to open websites from the command line.

For example, how would I open YouTube directly in Firefox without first opening the browser and then entering the address for YouTube?

share|improve this question
possible duplicate of Command to open a URL? –  Takkat Feb 20 at 20:22
add comment

4 Answers

up vote 4 down vote accepted

Use the command

firefox http://www.youtube.com

This should do it. 8 )

share|improve this answer
that did it!! just had to restart firefox. Thx :D –  ubuntu.stuff Feb 20 at 17:50
add comment

If you only need to open it in the background use:

wget http://askubuntu.com

To download a page (optionally mirror sub pages):

wget --mirror -p --convert-links -P ~/Desktop/ http://askubuntu.com/users/182026/kamil

If you want to open it and see it

and you use firefox:

firefox http://askubuntu.com

or you use google chrome

google-chrome http://askubuntu.com
share|improve this answer
oh that's a nice trick. thx a lot :D –  ubuntu.stuff Feb 20 at 17:52
I just tried it, but it doesn't work... –  ubuntu.stuff Feb 20 at 17:58
@ubuntu.stuff which one doesn't work for you? –  kamil Feb 20 at 18:01
well the very top one. wget does not do anything... –  ubuntu.stuff Feb 20 at 18:05
Indeed, it does, but you're not seeing what happened. do you want to save the page? –  kamil Feb 20 at 18:13
show 3 more comments

also look at xdg-open which uses the default program for opening the link

some documentation from Ubuntu:

xdg-open - opens a file or URL in the user’s preferred application

But works the same on Ubuntu

share|improve this answer
+1 For xdg-open! –  blade19899 Feb 20 at 23:44
add comment

If you want to use the web page from an xterm/command line then you can install lynx on Ubuntu 12.04 LTS. I have lynx-cur installed.

apt-get install lynx-cur

I don't think you need any special repositories,

lynx http://askubuntu.com

I use it to do screen scrapes

wget can be used as follows if you want to look at what is going by:

wget -O- -S http://askubuntu.com | more

This will send the output to stdout, and give you the server-response info

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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