PDF download Download Article
Access any web page from a terminal with these quick commands
PDF download Download Article

Whether you want to browse the web in a text-only browser or launch a GUI browser like Chromium or Firefox in a terminal on Linux, we have you covered. Read on to learn easy ways to browse the internet in a Linux terminal window, plus how to open a graphical browser using terminal commands.

Browsing the Internet from a Linux Terminal

  • To go to a website in a terminal, install a browser like w3m or Links2.
  • Once installed, use "w3m <website address>" or "links2 <website address>" to browse the web in a terminal window.
  • To open a graphical web browser like Chrome or Chromium from the command line, use "google-chrome &" or "chromium-browser &".
Section 1 of 3:

Browse from the Terminal with w3m

PDF download Download Article
  1. You can use the text-based w3m web browser to browse the internet from the terminal. It isn't preinstalled, but you can get the package from your distribution's default repositories.
    • If you're using Ubuntu or another Debian-based Linux, use the command sudo apt install w3m to get it.
    • On Red Hat, Fedora, or other RH-based distros, use sudo dnf install w3m.
    • On Arch Linux, Manjaro, or other distros that use the pacman package manager, use sudo pacman -S w3m.
  2. In the default terminal application, you won't be able to use w3m's handy right-click menu or view images. If you use xterm, a replacement terminal app, instead, you can right-click any page to access features like Back, View Source, Bookmark, and even a Quit option.
    • Xterm is available through your distro's repositories—just use the installation command from above but replace w3m with xterm to install it.
    • One installed, you can launch xterm by typing xterm at the prompt and pressing Enter or Return, or by selecting it in from your app list.
    Advertisement
  3. For example, if you want to browse wikiHow's website, type w3m www.wikihow.com and press Enter or Return.
    • If you want to see images on the page, you'll need to use a different terminal app like xterm.
    • Use the arrow keys to go up, down, left, or right, or just use your mouse.
    • To follow a link, select it and press Enter or Return.[1]
    • To type into a text box, click the text box with your cursor, press Enter or Return, type your text, and press Enter or Return again.
    • To follow a link, navigate to it using the arrow keys (or click it with your cursor), then press Enter or Return.
    • If you're using xterm instead of the default terminal app, right-click anywhere on the page to access additional options.
    • Press B to go back.
    • Use Shift+T to open a new tab.
    • In xterm, you can view an image by selecting it and pressing i.
    • To search for text on a page, press /, type your search term, and press Enter or Return. You can press n to find the next instance of your search term, or N (capital) to go back.
  4. Advertisement
Section 2 of 3:

Browse from the Terminal with Links2

PDF download Download Article
  1. Links2 is another web browser you can use to access the web from the Linux terminal. It even has a graphical version you can open from the command line if you prefer to see images and use your mouse to browse.
    • If using Ubuntu and other Debian-based Linux versions, install Links2 with sudo apt install links2.
    • On Red Hat, Fedora, or other RH-based distros, use sudo dnf install links2.
    • On Arch Linux, Manjaro, or other distros that use the pacman package manager, use sudo pacman -S links2.
  2. For example, if you want to browse wikiHow's website, type links2 www.wikihow.com and press Enter or Return.
  3. If you want features like images on the page, a back button at the top of the browser, and a right-click menu, include the "-g" option.
    • Press F9 to toggle the menu on or off.[2]
    • Use the arrow keys or your cursor to navigate.
    • To follow a link, select it, then press Enter or Return.
    • Press s to access your bookmark manager, where you can add, remove, and find bookmarks.
  4. Advertisement
Section 3 of 3:

Open a Browser from the Linux Terminal

PDF download Download Article
  1. Alternatively, you can enter a specific browser's application name, like google-chrome &, firefox &, or chromium-browser &.
    • Adding the & after the command allows you to continue typing commands into the terminal and close the terminal without closing your browser. If you're writing a script, you'll definitely want to use this option.
    • To open your default web browser from a terminal, you'd type x-www-browser &.
    • You can also go right to a website from the command line. For example, if you want to open Chromium to wikiHow's homepage, use chromium-browser www.wikihow.com &.
    • In Chrome, you can open your browser in Incognito mode using google-chrome --incognito &. For a complete list of Chrome command line switches, check out https://peter.sh/experiments/chromium-command-line-switches.

Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Tips

  • If you don't like w3m or links2, try some alternatives—there are plenty, including elinks, lynx, and brow.sh.
Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
Advertisement

About This Article

Nicole Levine, MFA
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for wikiHow. She has more than 20 years of experience creating technical documentation and leading support teams at major web hosting and software companies. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions. This article has been viewed 74,718 times.
How helpful is this?
Co-authors: 4
Updated: December 23, 2024
Views: 74,718
Categories: Linux
Thanks to all authors for creating a page that has been read 74,718 times.

Is this article up to date?

Advertisement