RaspberryTips

3 Best Ways to Access a Website in a Linux Terminal

Sometimes, you don’t have other options. You must access a website from the Linux terminal. I know I did this a few times when I worked as a sysadmin, and I’m going to share a few tips with you in this article.

Overall, Lynx is one of the best options to access a website in a Linux terminal. It’s easy to install and works on most distributions. It allows viewing the website content in text format, following links and scrolling through the page quickly.

But I have a few other options for you, so make sure you’re reading this article until the end, as maybe some of the alternatives are better suited for your needs.

Option 1: Lynx

Lynx is a terminal-based web browser, available on all distributions. That’s the first one I learned to use, and it never disappointed me since then, so I would recommend it as your first option too.

Installation

Lynx is generally not installed by default (weirdly, most people don’t browse the web from a terminal), but you can easily install it with your package manager.

For example, on Debian or Ubuntu, Lynx can be installed with APT : sudo apt install lynx

linux command visit website

Any additional requirements will be added automatically, but in theory, you don’t need much. As you can see on my screenshot (Ubuntu Server), I only need to download 2 MB to install it.

linux command visit website

Join Our Community!

Connect, learn, and grow with other Raspberry Pi enthusiasts. Support RaspberryTips and enjoy an ad-free reading experience. Get exclusive monthly video tutorials and many other benefits.

linux command visit website

If you’re new to the Linux command line, this article will give you the most important Linux commands to know, plus a free downloadable cheat sheet to keep handy.

Once installed, Lynx can be used from the command line. It works the same way whatever screen you use (console on a server edition, SSH , terminal on a GUI distribution , etc.).

The main command syntax is simply: lynx <url> So, for example: lynx raspberrytips.com

The website shows up in this format:

linux command visit website

Obviously, websites are not optimized for this browser, but you can still find what you are looking for. Use the up/down arrows to scroll through the content.

Colors will help to understand the structure of the page. On my screenshots, links are colored in green, you can select them and press Enter or the right arrow to follow them. Bolded text is in red, etc.

You can press H at anytime to see the help, and then click on “Key-stroke commands” for a full list of shortcuts. Here are a few useful ones:

  • Left arrow : Go to previous visited URL in the history.
  • + or Space : Scroll down to next page
  • – or b : Scroll up to previous page
  • CTRL+A : Go to first page
  • CTRL+E : Go to last page
  • q : Close Lynx

I’m clearly not using Lynx every day, but I had to use it a few times in my career and I can confirm it does its job perfectly. I would recommend installing it, and trying if it does what you need on your server. But if you want to see other options, keep reading for alternatives.

Option 2: W3m

W3m is very similar to Lynx with its core features. But it provides a more feature-rich interface with support for mouse interaction, inline image display, and tabbed browsing.

W3m is also available in the default repository for most distributions, so you can use your package manager to install it.

For example, on Debian or Ubuntu-based systems, just use: sudo apt install w3m

Once installed, W3m has a similar syntax to Lynx. You can open a web page with: w3m <url>

So, for example: w3m raspberrytips.com

The result is slightly different, but pretty much look the page we got with Lynx:

linux command visit website

You can see in this example that links are colored in blue, bullet lists are working, so it’s readable, even if you don’t get the normal design with subheadings highlighted, images, etc.

From thee, you’ll use many shortcuts to use the more advanced features included with W3m. Here are a few examples:

  • SHIFT + H : Open the help with all the shortcuts
  • SHIFT + B : Exit the help
  • / or ? : Search (forward or backward). Use “n” to go to the next occurrence after that.
  • SHIFT + T : Open a new tab (with the same url)
  • SHIFT + {} : Switch between tabs
  • CTRL + Q : Close the current tab
  • SHIFT + U : Edit current URL

You can find the documentation here , with more examples listed.

Option 3: Download the web page

If you can’t install any new package on the system, or prefer to download the HTML code before parsing it in a script or opening it with any other text editor, here are two other options for you.

Wget is a command-line utility that allows you to download files from the Internet. It supports most web protocols (HTTP, HTTPS, FTP, …) store the target URL in a local file, on your computer or server.

Wget is often pre-installed on most distributions. It’s commonly used to download sources code from GitHub or software editors, but you can also use it to download HTML pages.

The basic syntax is: wget <url> For example: wget https://raspberrytips.com

linux command visit website

In this example, it created a file name “index.html” in the current directory. But you can specify the destination file with this option: wget <url> -O <file> For example: wget https://raspberrytips.com -O /home/pat/Downloads/rpitips-home.html

From there, you can use Nano to read the HTML file (with all its tags), or send it to your computer and open it with a most user-friendly editor or web browser .

It’s clearly not optimized for human reading on the server directly, but if you only have to do this once, or maybe need to parse a website in a script, that’s fine. It should work. Also check my tip at the end to remove all tags from the HTML file in one command.

Curl is another popular Linux command that does basically the same thing. There are way more features available with curl, but to download a simple HTML page, it’s almost the same.

The main syntax is: curl <url>

A first difference is that curl displays the HTML code directly on your screen, you need to redirect it if you want to save it in a local file: curl <url> > myfile.html

linux command visit website

From there, the result is the same as with “wget”. You get an HTML file, with the full source code of the page, and can use any editor or browser to open it.

The benefits of using curl over wget, is that it’s better suited for scripting (most languages have libraries for curl by the way), with many options allowing to access any website (skip HTTPS certificate check, send POST data, upload files, etc.).

Check the curl documentation here if you need more guidance, and here are, as an example, all the functions available in PHP to interface with curl . Most languages will have something similar.

Note : You can send the result of the curl request to a tool like html2text to remove the HTML tags for you, so you only see the readable texte, something like: curl https://raspberrrytips.com | html2text You may need to install it first with: sudo apt install html2text

And if nothing works as expected, maybe you should consider installing a light GUI on your server .

If you liked this article, here are a few more tips about command lines on Linux that might be interesting to you:

  • 50 Most Useful Linux Commands You Need To Know (Cheat Sheet)
  • How To Change DNS Settings On Ubuntu Servers (Commands)
  • How To Install the Latest GNOME on Debian (3 easy steps)

Reminder: Remember that all the members of my community get access to this website without ads, exclusive courses and much more. You can become part of this community for as little as $5 per month & get all the benefits immediately.

  • Master Linux Commands (eBook)
  • The 5 fastest ways to find a file on Linux
  • Snap vs APT: what's the difference?

Additional Resources

Overwhelmed with Linux commands? My e-book, “Master Linux Commands”, is your essential guide to mastering the terminal. Get practical tips, real-world examples, and a bonus cheat sheet to keep by your side . Grab your copy now . VIP Community If you just want to hang out with me and other Linux fans, you can also join the community. I share exclusive tutorials and behind-the-scenes content there. Premium members can also visit the website without ads. More details here. Need help building something with Python? Python is a great language to get started with programming on any Linux computer. Learn the essentials, step-by-step, without losing time understanding useless concepts. Get the e-book now.

' src=

I'm the lead author and owner of RaspberryTips.com. My goal is to help you with your Raspberry Pi problems using detailed guides and tutorials. In real life, I'm a Linux system administrator with web developer experience.

Similar Posts

Ubuntu Server: How To Enable The Root User (Login & SSH)

Ubuntu Server: How To Enable The Root User (Login & SSH)

For a long time, root was the default user on Linux, but it’s now disabled on most distributions. If like me, you were used to it, this article will answer your questions and guide you with the new best practice. I’ll also show you some workarounds if you really need “root”. On Ubuntu Server, using…

How To Install RetroPie On Ubuntu: A Step-by-step Guide

How To Install RetroPie On Ubuntu: A Step-by-step Guide

RetroPie is a free solution to play classic games on a computer. It’s often used to promote Raspberry Pi, but it can also be installed on any computer, such as Ubuntu. This is exactly what I will show you today: a complete guide to installing RetroPie on Ubuntu, from start to finish. Ubuntu is officially…

How to Set Up Wi-Fi on Debian (3 ways)

How to Set Up Wi-Fi on Debian (3 ways)

Configuring a wireless connection on Linux, especially if you don’t have a desktop interface, is particularly challenging. I recently tried using it on Debian, and it was a mess, with drivers missing and obsolete commands. I did find a solution, so I thought it would be a good idea to share everything with you in…

How To Install the Latest Python Version on Linux?

How To Install the Latest Python Version on Linux?

New versions of Python are released all the time, and there are generally several series available at the same time. Different applications on your system may have different requirements in terms of Python version, and the goal of this tutorial is to show you how to install and use the one you need (even if…

How To Connect Ubuntu To Your Wi-Fi (Desktop & Server)

How To Connect Ubuntu To Your Wi-Fi (Desktop & Server)

Ubuntu is a great Linux distribution for beginners, with most things being intuitive enough to get started quickly. It doesn’t mean that everything is easy. One of the first steps will be to connect your computer or server to the Internet, and you may need some help, especially with a Wi-Fi connection. Well, you’re at…

Why Swap Is Used In Linux? (Goal, Requirements and Commands)

Why Swap Is Used In Linux? (Goal, Requirements and Commands)

As recent computers include more and more memory, we could wonder if swap is still required on Linux systems. In short, the swap partition is like a backup for your RAM: do you still need it? Why and when it is used? I’ll answer all your questions in this article. On Linux systems, the swap…

Level Up Your Linux Skills: Free PDF with Must-Know Linux Commands!

Tecmint: Linux Howtos, Tutorials & Guides

9 Command Line Tools for Browsing Websites and Downloading Files in Linux

In the last article, we have covered few useful tools like ‘ rTorrent ‘, ‘ wget ‘, ‘ cURL ‘, ‘ w3m ‘, and ‘ Elinks ‘. We got lots of responses to cover few other tools of the same genre, if you’ve missed the first part you can go through it.

  • 5 Command Line Tools for Downloading Files and Browsing Websites

This article aims to make you aware of several other Linux command Line browsing and downloading applications, which will help you browse and download files within the Linux shell.

Links is an open-source web browser written in C programming Language. It is available for all major platforms viz., Linux, Windows, OS X, and OS/2.

This browser is text-based as well as graphical. The text-based links web browser is shipped by most of the standard Linux distributions by default. If links not installed in your system by default you may install it from the repo. Elinks is a fork of links .

After installing links , you can browse any websites within the terminal as shown below in the screencast.

Use UP and DOWN arrow keys to navigate. The right arrow Key on a link will redirect you to that link and the  Left arrow key will bring you back to the last page. To QUIT press q .

Here is how it seems to access Tecmint using the links tool.

If you are interested in installing the GUI of links , you may need to download the latest source tarball (i.e. version 2.22) from http://links.twibright.com/download/ .

Alternatively, you may use the following wget command to download and install as suggested below.

Note: You need to install packages (libpng, libjpeg, TIFF library, SVGAlib, XFree86, C Compiler and make), if not already installed to successfully compile the package.

Links2 is a graphical web browser version of Twibright Labs Links web browser. This browser has support for mouse and clicks. Designed especially for speed without any CSS support, fairly good HTML and JavaScript support with limitations.

To install links2 on Linux.

To start links2 in command-line or graphical mode, you need to use the -g an option that displays the images.

links2 in commandline mode

A text-based web browser released under GNU GPLv2 license and written in ISO C. lynx is a highly configurable web browser and Savior for many sysadmins. It has the reputation of being the oldest web browser that is being used and still actively developed.

To install lynx on Linux.

After installing lynx , type the following command to browse the website as shown below in the screencast.

If you are interested in knowing a bit more about links and lynx web browser, you may like to visit the below link:

  • Web Browsing with Lynx and Links Command Line Tools

4. youtube-dl

youtube-dl is a platform-independent application that can be used to download videos from youtube and a few other sites. Written primarily in python and released under GNU GPL License, the application works out of the box. (Since youtube doesn’t allow you to download videos, it may be illegal to use it. Check the laws before you start using this.)

To install youtube-dl in Linux.

After installing, try to download files from the Youtube site, as shown in the below screencast.

If you are interested in knowing more about youtube-dl you may like to visit the below link:

  • YouTube-DL – A Command-Line Youtube Video Downloader for Linux

fetch is a command-line utility for a Unix-like operating system that is used for URL retrieval. It supports a lot of options like fetching ipv4 only address, ipv6 only address, no redirect, exit after successful file retrieval request, retry, etc.

Fetch can be Downloaded and installed from the link below

http://sourceforge.net/projects/fetch/?source=typ_redirect

But before you compile and run it, you should install HTTP Fetcher. Download HTTP Fetcher from the link below.

http://sourceforge.net/projects/http-fetcher/?source=typ_redirect

Axel is a command-line-based download accelerator for Linux . Axel makes it possible to download a file at a much faster speed through a single connection request for multiple copies of files in small chunks through multiple http and FTP connections.

To install Axel in Linux.

After axel installed, you may use the following command to download any given file, as shown in the screencast.

aria2 is a command-line-based download utility that is lightweight and supports multi-protocol (HTTP, HTTPS, FTP, BitTorrent, and Metalink). It can use meta link files to simultaneously download ISO files from more than one server. It can serve as a Bit torrent client as well.

To install aria2 in Linux.

Once aria2 installed, you can fire up the following command to download any given file…

If you’re interested to know more about aria2 and its switches, read the following article.

  • Aria2 – A Multi-Protocol Command-Line Download Manager for Linux

w3m is another open-source text-based web browser very similar to lynx , which runs on a terminal. It uses emacs-w3m an Emacs interface for w3m to browse websites within the emacs interface.

To install w3m in Linux.

After installing w3m , fire up the following command to browse the website as shown below.

Browsh is a modern text-based browser that shows anything like a modern browser does such as HTML5, CSS3, JS, video, and even WebGL. Its major role is to be run on a remote server via SSH or Mosh and browse the web pages as text from the terminal by significantly reducing bandwidth and increase browsing speed.

It means the server downloads the web pages and utilizes the minimum bandwidth of an SSH connection to show the web page results. However, standard text-based browsers lack JS and all other HTML5 support.

Browsh Web Browsing

To install Browsh on Linux, you need to download a binary package and install it using the package manager.

That’s all for now. I’ll be here again with another interesting topic you people will love to read. Till then stay tuned and connected to Tecmint. Don’t forget to provide us with your valuable feedback in the comments below. Like and share us and help us get spread.

Previous article:

Next article:

Photo of author

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Related Posts

XDM Download Manager for Linux

XDM – Download Manager with a 500% Speed Increase for Linux

Downloading Files and Browsing Internet in Terminal

5 CLI Tools for Downloading Files and Browsing Internet in Terminal

Download Managers for Linux

10 Most Popular Download Managers for Linux in 2023

Axel - Linux Commandline Download Accelerator

Axel – A Command-Line File Download Accelerator for Linux

Aria2- Commandline Download Tool for Linux

Aria2 – A Multi-Protocol Command-Line Download Tool for Linux

Install uGet Download Manager in Linux

Install uGet Download Manager 2.0 in Debian, Ubuntu, Linux Mint and Fedora

9 thoughts on “9 Command Line Tools for Browsing Websites and Downloading Files in Linux”

Browsh is one more terminal browser that is able to display images and videos (poor ASCII quality). Also, wget and curl for downloading files.

I have added the Browsh text browser to the list as suggested by you. About wget and curl, we already covered in part 2 of this article here – https://www.tecmint.com/linux-command-line-tools-for-downloading-files/

links2 is wonderful for simpler webpages in GUI mode. RAM usage is practically zilch and it handles some JS to boot. Was playing around with it for about 1/2 an hour just now. You can get some decent color (text, link, background) combos too and it does local file navigation very nicely (input url: “file://”)

between, was looking for a simple terminal-based markdown viewer and came across ‘Terminal Markdown Viewer’ (mdv at github). It’s one of the few that’s python-based (pip install) and does a really nice job rendering MD locally. I suppose this makes it a subClass of the more able full-fledged browsers.

Lynx works well too because it at least colorizes certain tags – so the output looks nice:

Also… finding that w3m does MD locally pretty well via pandoc, though the output is blander but the html support is actually stronger than I expected:

Anyway, thought I’d share a specific use-case.

I love the way that the different tools are showcased in the text itself. Thank you for making such a well designed site

Lynx is a good cli web browser. In fact I am using lynx right now.

Great article. Can any of these tools be used over ssh? I am looking for a tool that can resume downloads over ssh if interrupted other than rsync (not supported on the system)

Unfortunately, there isn’t any tool that can able to resume interrupted downloads over ssh…

Could you use screen? Might work for some aspects, of this scenario…..

Thanks a lot, very useful tutorial,

I am using “youtube-dl” for downloading playlist and videos Very nice tool, following will give you max quality with HD [22]

youtube-dl -i –playlist-start 1 –max-quality 22 “URL”

Thanks, Kiran Patil

Got something to say? Join the discussion. Cancel reply

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.

Save my name, email, and website in this browser for the next time I comment.

  • Linux Acronyms

2DayGeek

Linux and Unix, Open Source, Linux Howtos

How to Open/Access/Browse a Website Right from Your Linux Terminal

I always remember old days when i browse any websites in Linux terminal.

Initially it was a simple as searchable text that allows users to access the web through text-based web browser with tortoise-paced internet connections.

Over the period of time, the browser technology got a lot of improvements towards to the graphical mode.

In general, we are using powerful graphics based Web Browsers such as Chrome, Firefox and Opera.

But still there are people who are mostly working in terminal prefer accessing the text-based browsers.

We always use man pages for command line helps, however, it gives only limited information like list of available options for a command and few examples.

If you need some more troubleshooting information, which you doesn’t know then you may want to look for third party websites, at the time only text-based browsers can help you to gather the information.

The text-based browsers are widely used by Linux administrator in headless server to browse websites.

There are many Linux command-line browsers are available and we will be listing all of them in this article and you can choose the suitable one, which you are preferring.

List of text-based web browsers available in Linux are listed below.

1) How to Open a Website Right from Your Linux Terminal Using links Command

links is a web browser running in both graphics and text mode.

It renders complex pages, supports color and monochrome terminals and allows horizontal scrolling.

By default links package were bundled with Linux Distribution so, we can easily install it through distribution package manager.

linux command visit website

2) How to Access a Website Right from Your Linux Terminal Using elinks Command

elinks is fork from Links, Full-Featured Text web Browser, advanced and well-established feature-rich text mode web browser.

elinks can render both frames and tables, is highly customizable and can be extended via Lua or Guile scripts. It is quite portable and runs on a variety of platforms.

linux command visit website

3) How to Browse a Website Right from Your Linux Terminal Using lynx Command

lynx is a highly configurable text-based web browser for use on cursor-addressable character cell terminals. It’s the oldest web browser and it’s still in active development.

linux command visit website

4) How to Open a Website Right from Your Linux Terminal Using w3m Command

w3m is a text-based web browser as well as a pager like `more’ or `less’. With w3m you can browse web pages through a terminal emulator window (xterm, rxvt or something like that).

Moreover, w3m can be used as a text formatting tool which typesets HTML into plain text.

linux command visit website

5) How to Access a Website Right from Your Linux Terminal Using browsh Command

browsh is a advanced, well-established, feature-rich, modern and pure text based browser which supports graphics and video.

It supports HTML5, CSS3, JavaScript, video, photos and WebGL content. The terminal client updates and renders in real time that allow us to watch videos (It uses the UTF-8 half-block trick (▄) to get 2 colours from every character cell, thus simulating basic graphics) from browsh.

linux command visit website

Related Posts

Configure VLAN Tagging over Bonding on RHEL

How to Configure VLAN Tagging Over Bonding on RHEL

September 6, 2023 September 6, 2023

Configure LACP Bonding on RHEL

How to Configure Network Bonding or Teaming on RHEL

August 28, 2023 August 28, 2023

Mapping SAN LUN to Physical Disk and FileSystem in Linux

How to map SAN LUN, Disk and FileSystem in Linux

June 3, 2023 June 3, 2023

linux command visit website

About Magesh Maruthamuthu

Love to play with all Linux distribution

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

How to access web page via terminal?

I am testing an Apache server. Normally I open x.x.x.x/directory/index.php in Firefox, then read the httpd/error_logs and troubleshoot.

My question is, what if I don’t have a Web browser (e.g., Chrome/Firefox) on my test system? How can I do an equivalent test via the terminal? I tried ping x.x.x.x/directory/index.php but it doesn’t work that way.

  • command-line-interface

cxw's user avatar

  • 8 Try curl, wget, lynx, links, w3m, ... –  Michael Hampton Aug 24, 2015 at 0:34

6 Answers 6

My question is, what if I don’t have Chrome/Firefox on? How can I do the equivalent test via the terminal? I tried ping x.x.x.x/directory/index.php but it doesn’t work that way.

Using ping would never work. All ping does is send/receive ICMP packets from a network address. So in your example, the only thing you could actually “ping” is ping x.x.x.x with the remainder of the URL ( /directory/index.php ) just choking ping as it attempts to resolve the whole URL as if it were a hostname. The error would be something like:

But for the specific type of web server testing/debugging you are looking for, I usually use curl but specifically I use curl -I -L which will throw back just basic response headers and follow any location redirects the server might have in place; the -I flag tells curl to just show the header and -L flag tells curl to follow any server redirects it encounters.

For example, if I run this curl -I -L command on google.com :

I get the following response headers:

Note there are two headers returned:

  • HTTP/1.1 301 Moved Permanently
  • HTTP/1.1 200 OK

This is useful not just for Apache server testing but also useful for debugging mod_rewrite rewrite rules and such.

This curl -I -L method is far more useful and efficient than using a visual browser like Chrome or Firefox since those programs are designed to optimize browsing speed by caching content. Which means you can make an adjustment to your Apache server one second, but the visual browser won’t necessarily show the change right away unless you clear the cache or force the page to reload a few times. The curl -I -L shows you exactly what the server at that moment is doing in response to your request which is exactly what you want/need when debugging server configs.

Giacomo1968's user avatar

The command you want is either curl or wget (depending on your personal preferences). These commands make a HTTP request to the server. They're not great for simulating the load of an entire page (they don't, by default, load the assets referenced by the HTML page, and they can't execute javascript or interact with the page at all), but it doesn't sound like you're after anything that advanced. So, curl or wget will almost certainly work fine for you.

womble's user avatar

@womble is right. However, if you don't have curl or wget , you can use telnet:

Then hit Enter one more time (for the end of headers) and you’ll get the raw HTML. You may have to hit Ctrl + D (Unix) or Ctrl + Z (Windows) to exit if the server uses keepalive.

You may want to use a text based browser . This option will let you traverse the web page and test more of its components. Things like forms for example, since it is a full-fledged browser.

Use lynx , or its younger brother links , or elinks .

Tośka's user avatar

  • elinks worked the best. lynx wasn't able to display a table properly, the cells were out of the column position and links wasn't able to save the output to file. –  Shayan Jun 28, 2019 at 20:23

You can issue a GET request with OpenSSL:

Note that you can also use "HTTP/2", but be careful because some servers (e.g. github.com) do not support it.

Zombo's user avatar

If you want to actually view the page, I would recommend using Lynx , which was one of Michael Hampton's recommendations. It renders the HTML and the page can be interacted with via the keyboard. Just don't expect any fancy animations or pictures. :)

It is available via virtually all package managers, the ones on Mac OS X included.

phoenix's user avatar

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged linux apache-2.2 command-line-interface ..

  • The Overflow Blog
  • Diverting more backdoor disasters
  • How to succeed as a data engineer without the burnout
  • Featured on Meta
  • New Focus Styles & Updated Styling for Button Groups
  • Upcoming initiatives on Stack Overflow and across the Stack Exchange network

Hot Network Questions

  • Why is my car paint not so "shiny"?
  • Why do Chinese people complicate the matter in choosing the words for translation
  • Why aren't there kamikaze warp bombs?
  • How to get a copy of a refusal letter for a Canadian visa application?
  • Understanding the verb 諫める: broader than English "to admonish"?
  • Output a 1-2-3 sequence
  • How does a Neural Net handle an unseen class for a Categorical Feature?
  • What kind of lightbulb is pictured here, having a clear bulb window and 4 yellow vertical rods?
  • ER diagram with empty boxes as a worksheet
  • Why does macOS start ssh-agent with -l?
  • What words of endearment may I use for describing a misbehaving child?
  • D&D 5e: Does the same spell prepared for different levels count as multiple prepared spells or the same prepared single spell?
  • Simple problems that calculators get wrong
  • Does scouring a stainless-steel pan cause it to release metals into food?
  • Are there scientific research articles published in reputable journals that provide supporting evidence for Young Earth Creationism?
  • Why do protests happen in the light of their apparent futility
  • E-bike battery placement on the seat tube
  • Michael Noll's early computer art - arranging graphic elements in a circular manner
  • Breaking New Ground
  • How do you measure specific impulse Isp of a rocket engine?
  • How can my book purchase get the most money to an author?
  • Is there a report that shows what is duplicated between contacts ? For example: contacts sharing an email, or a phone number
  • What is "bends" in "Barely even friends, then somebody bends" (Beauty and the Beast)?
  • Do I have to pay a licensing fee to mix in Atmos? What about other dolby formats?

linux command visit website

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Browsing the internet from the command line

How can I browse the Internet from the command line in Ubuntu?

  • command-line
  • webbrowser-app

K7AAY's user avatar

14 Answers 14

There are actually a bunch of text-mode web-browsers, these are my top three :)

ELinks ( install ):

elinks screenshot

Keyboard Shortcuts

  • Open new tab - t
  • Goto URL - g
  • Go back - Left
  • Go forward - u
  • Toggle images - *
  • Toggle link numbering - .
  • Toggle document colours - %
  • Next tab - >
  • Previous tab - <
  • Close tab - c
  • Open in new tab in background - T

Automatic URL rewrites

  • d - dictionary search
  • dmoz - dmoz search
  • g - google search
  • wiki - wikipedia search

Lynx ( install ):

lynx screenshot

  • Lynx User-Guide

w3m ( install ):

w3m screenshot

Wikipedia has a List of more text-based web-browsers , not all of which are available in Ubuntu.

Community's user avatar

  • 1 Its a very old post and my question is also odd but can you tell while browsing internet using w3m how to open a "linked" new tab website.. Just like Open link in new tab feature available in chrome. If this cant be done in w3m can you suggest any other text-mode web-browsers –  Eka Apr 10, 2015 at 20:25
  • 1 Wow, thanx for mentioning elinks' inbuilt search rewrites ("smart prefixes").. somehow missed them although I've been using elinks (with joy!) for years! here's a conf line to invoke it nicely from inside tmux , the 21st century terminal multiplexer: bind-key g command-prompt -p "google:" "split-window -c '#{pane_current_path}' -p 90 'elinks -no-home -no-connect \"g %%\"'" –  eMPee584 Jul 15, 2015 at 11:22

To my surprise it exists; I installed it and it works!

  • to open a webpage simply type in a terminal window: w3m <url_of_the_webpage>
  • to open a new page: type Shift -U
  • to go back one page: Shift -B
  • open a new tab: Shift -T

W3M can handle Gmail(!)

If you use for example XTerm (not Gnome Terminal), W3M is even capable of showing images!

linux command visit website

For more information see “ How to Browse From the Linux Terminal With W3M ”.

David Foerster's user avatar

  • Wow! This is amazing! Though lynx is better but w3m is the best!! –  opu 웃 May 3, 2014 at 13:38
  • @Scotia what do we need Firefox for :) –  Jacob Vlijm May 3, 2014 at 13:40
  • 1 @ Jacob Vlijm, Yes! There is no need of firefox now! ;) –  opu 웃 May 3, 2014 at 13:44
  • 2 OMG! This thing made my day! Managed to login to some website and download some software I needed on a remote server! Even has a nice progress bar! EPIC! –  paul-g Feb 11, 2016 at 18:52
  • This comes pre-installed with Ubuntu Server 12.04 LTS –  Akira Yamamoto Jun 27, 2017 at 23:33

links2 -g is a strange terminal-embedded graphical-mode browser. It's fast but hates modernity.

If you like to search from the command line, try surfraw .

Trivia note : Surfraw was originally written by Julian Assange. (Acronym/backronym for 'SURFRAW' is Shell Users' Revolutionary Front Rage Against the World Wide Web.)

Here's some example usage. To search Google for "nm-applet memory leak" : sr google nm-applet memory leak

To search for an RFC dealing with S/MIME: sr rfc s/mime

Translate a word: sr translate logiciel

Find torrents: sr piratebay natty narwhal

More advanced, from surfraw.alioth.debian.org :

You can set it up with some defaults in .config/surfraw/conf :

belacqua's user avatar

If you meant a CLI based Internet browser, use w3m:

Lekensteyn's user avatar

  • 1 There's also links, which I personally like better than w3m. –  Cedric Mar 8, 2011 at 17:13
  • 1 links or lynx ? I prefer curl -vvv http://example.com/ 2>&1 | less , but that is not really a browser. –  Lekensteyn Mar 8, 2011 at 17:24
  • Thanks I was looking for the www command line browser. Looks like w3m is it, or something very close! –  jerome Jan 6, 2013 at 3:09
  • @Lekensteyn Is there a way to make less skip all the HTML tags? A lot of websites today have things like ad banners and tags that link to Google Analytics or something and it makes it really hard to read the content. –  Arc676 Jul 31, 2015 at 16:53
  • @Arc676 You could try the html2text program to interpret tags and convert them to text (installable from the repos, manual page . –  Lekensteyn Jul 31, 2015 at 17:46

My personal favorite of the text-based browsers is links2 . You can install it with

And then load a webpage with

Other alternatives that have not been mentioned are:

elinks : "an advanced and well-established feature-rich text mode web (HTTP/FTP/..) browser. ELinks can render both frames and tables, is highly customizable and can be extended via Lua or Guile scripts. It is quite portable and runs on a variety of platforms"

retawk : "an interactive, multi-threaded network client (web browser) for text terminals on computers with Unix-like operating systems. It is written in C, fast, small, nicely configurable, and comfortable; e.g. the low-level network communications are performed in a non-blocking way, and you can keep open as many "virtual windows" as you want and work simultaneously in two of them in a split-screen mode"

gioele's user avatar

Another very good command line browser is lynx .

The most basic usage would be:

It will most likely ask if you want to allow cookies.

To navigate the page use the arrow keys. Here is a short description of the most important ones.

  • Left - move back in history
  • Right - follow a link
  • Up - move to previous focusable item
  • Down - move to next focusable item
  • Enter - enter link / trigger action
  • Backspace - history page
  • Space - move page down by a page
  • b - move page up by a page
  • Shift + q - Quit

That is the most basic key navigation commands.

wjandrea's user avatar

Browsh might be a solution. From the site:

Browsh is a fully-modern text-based browser. It renders anything that a modern browser can; HTML5, CSS3, JS, video and even WebGL. Its main purpose is to be run on a remote server and accessed via SSH/Mosh or the in-browser HTML service in order to significantly reduce bandwidth and thus both increase browsing speeds and decrease bandwidth costs.

It uses headless Firefox in the background to run the interactive stuff. It's frequently updated .

Andrew Arrow's user avatar

  • 3 Would you please edit your answer to include the main purpose of Browsh, how to download/install and perhaps a how to nav around within it etc. Thanks –  xtrchessreal Jul 17, 2018 at 18:13
  • @xtrchessreal ssh into brow.sh( ie open terminal alt+ctr+t , then type ssh brow.sh ) –  suhailvs Dec 15, 2018 at 1:35

You want a text browser or a command line method? This is command line, using telnet e.g.

telnet askubuntu.com 80

It doesn't support SSL, graphics, HTML5 etc and you might have to guess the index page if the server doesn't have a default file. But it is better than nothing and a very quick testing tool.

jqa's user avatar

  • 15 This is the worst web browser ever :D –  Danyal Aytekin Feb 27, 2014 at 17:29

Yes, you can use lynx .

From man lynx :

Lynx is a fully-featured World Wide Web (WWW) client for users running cursor-addressable, character-cell display devices (e.g., vt100 terminals, vt100 emulators running on Windows 95/NT or Macintoshes, or any other "curses-oriented" display). It will display hypertext markup language (HTML) documents containing links to files residing on the local system, as well as files residing on remote systems running Gopher, HTTP, FTP, WAIS, and NNTP servers. Current versions of Lynx run on Unix, VMS, Windows 95/NT, 386DOS and OS/2 EMX.

You can install it by executing the following command:

Louis Matthijssen's user avatar

  • 1 I have installed lynx . But how can I open it? It is not in dash! –  opu 웃 May 3, 2014 at 13:27
  • 2 Since you're asking for a terminal browser, you should just execute lynx in your terminal. –  Louis Matthijssen May 3, 2014 at 13:27
  • 1 oh yea!! Now I got it!! –  opu 웃 May 3, 2014 at 13:29

You can use W3M for this purpose. Also there is lynx .

They can handle basic features, and are ok if you want to set up your router via your home workstation by ssh, for example. I would prefer using a local instance of a browser forwarding connection with ssh

davidbaumann's user avatar

Another program that might work for you is lynx . It is a terminal based web browser.

Kalle Richter's user avatar

If you'd like to avoid extra installations, you can hand-craft http requests. This is an http minimal request:

This is an https request:

Hello World's user avatar

You can use the browser lynx . It is available in the Ubuntu repositories:

Here is further information: http://en.wikipedia.org/wiki/Lynx_(web_browser)

chili555's user avatar

A chromium based browser has been released called carbonyl

https://github.com/fathyb/carbonyl

enter image description here

You must log in to answer this question.

  • The Overflow Blog
  • Diverting more backdoor disasters
  • How to succeed as a data engineer without the burnout
  • Featured on Meta
  • New Focus Styles & Updated Styling for Button Groups
  • Upcoming initiatives on Stack Overflow and across the Stack Exchange network
  • AI-generated content is not permitted on Ask Ubuntu
  • Let's organize some chat workshops

Hot Network Questions

  • Is this a photo of a historical reinactment of an 1868 treaty signing?
  • Writing a general solution to differential equation with Bessel functions
  • Wheel scratched carbon on ride
  • Understanding the verb 諫める: broader than English "to admonish"?
  • Separating Gamma in two independent functions
  • Simple problems that calculators get wrong
  • D&D 5e: Does the same spell prepared for different levels count as multiple prepared spells or the same prepared single spell?
  • How can I use ogr2ogr to left join a CSV to a GPKG file and produce a GeoJSON output in a scalable way?
  • How does this HF 'coupler' work?
  • Ways to Say "Forcibly Inducted"
  • Problem with tkz-euclide
  • Why is the general term of the sequence obtained using the RSolve function incorrect? Could it be a bug?
  • What is the difference between "residuo" and "desecho"?
  • What happens if the US President-elect is sent to prison before assuming power?
  • ER diagram with empty boxes as a worksheet
  • Did any country in the G20 not condemn the Iranian drone & missile attack on Israel?
  • After creating HTML, why did Tim Berners-Lee bother creating HTTP? Why didn't he just write a HTML renderer for a FTP client?
  • Does the current “ruling ontology” deny any possibility of a social causation of mental illness?
  • Is this damage to a plastered brick wall from furniture typical?
  • Could a Landlord (sucessfully) sue AirBnB when a tenant is subletting against their lease?
  • Ryanair seating policy: will two passengers be seated apart if you don't pay for a seat?
  • What type of aircraft do Tintin and Capitain Haddock use on their way to Peru in "The Seven Crystal Balls"?
  • How does a Neural Net handle an unseen class for a Categorical Feature?
  • Shuttle dance bank angle timeline

linux command visit website

  • PRO Courses Guides New Tech Help Pro Expert Videos About wikiHow Pro Upgrade Sign In
  • EDIT Edit this Article
  • EXPLORE Tech Help Pro About Us Random Article Quizzes Request a New Article Community Dashboard This Or That Game Popular Categories Arts and Entertainment Artwork Books Movies Computers and Electronics Computers Phone Skills Technology Hacks Health Men's Health Mental Health Women's Health Relationships Dating Love Relationship Issues Hobbies and Crafts Crafts Drawing Games Education & Communication Communication Skills Personal Development Studying Personal Care and Style Fashion Hair Care Personal Hygiene Youth Personal Care School Stuff Dating All Categories Arts and Entertainment Finance and Business Home and Garden Relationship Quizzes Cars & Other Vehicles Food and Entertaining Personal Care and Style Sports and Fitness Computers and Electronics Health Pets and Animals Travel Education & Communication Hobbies and Crafts Philosophy and Religion Work World Family Life Holidays and Traditions Relationships Youth
  • Browse Articles
  • Learn Something New
  • Quizzes Hot
  • This Or That Game New
  • Train Your Brain
  • Explore More
  • Support wikiHow
  • About wikiHow
  • Log in / Sign up
  • Computers and Electronics
  • Operating Systems

How to Browse the Internet Using the Terminal in Linux

Last Updated: April 7, 2019

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time. This article has been viewed 64,440 times. Learn more...

Have you ever wondered how to view web pages in a command line in Linux? Start with step one to learn how to do it, using two different tools.

Step 1 Go to the terminal and type this command sudo apt-get install w3m w3m-img.

  • Use ⇧ Shift + U to open a new web page.
  • Use ⇧ Shift + B to go back to the previous page.
  • Use ⇧ Shift + T to open a new tab.

Using Links2

Step 1 Go to the terminal and type this command sudo apt-get install links2.

Expert Q&A

  • Use XTerm instead of the normal gnome terminal while working with W3M so that all the images appear perfectly. Thanks Helpful 0 Not Helpful 1
  • There are many other terminal browsers you may like to try, like: elinks, lynx and retawlk. Note that it's only a difference of tastes and it's up to you to what one you pick. Thanks Helpful 0 Not Helpful 0

linux command visit website

You Might Also Like

linux command visit website

About This Article

  • Send fan mail to authors

Is this article up to date?

Am I a Narcissist or an Empath Quiz

Featured Articles

Show Integrity

Trending Articles

View an Eclipse

Watch Articles

Make Sticky Rice Using Regular Rice

  • Terms of Use
  • Privacy Policy
  • Do Not Sell or Share My Info
  • Not Selling Info

wikiHow Tech Help Pro:

Level up your tech skills and stay ahead of the curve

Use the internet from the command line with curl

Blender Hotkey Cheat Sheet

Opensource.com

Curl is commonly considered a non-interactive web browser. That means it's able to pull information from the internet and display it in your terminal or save it to a file. This is literally what web browsers, such as Firefox or Chromium, do except they render the information by default, while curl downloads and displays raw information. In reality, the curl command does much more and has the ability to transfer data to or from a server using one of many supported protocols, including HTTP, FTP, SFTP, IMAP, POP3, LDAP, SMB, SMTP, and many more. It's a useful tool for the average terminal user, a vital convenience for the sysadmin, and a quality assurance tool for microservices and cloud developers.

Curl is designed to work without user interaction, so unlike Firefox, you must think about your interaction with online data from start to finish. For instance, if you want to view a web page in Firefox, you launch a Firefox window. After Firefox is open, you type the website you want to visit into the URL field or a search engine. Then you navigate to the site and click on the page you want to see.

More Linux resources

  • Linux commands cheat sheet
  • Advanced Linux commands cheat sheet
  • Free online course: RHEL Technical Overview
  • Linux networking cheat sheet
  • SELinux cheat sheet
  • Linux common commands cheat sheet
  • What are Linux containers?
  • Our latest Linux articles

The same concepts apply to curl, except you do it all at once: you launch curl at the same time you feed it the internet location you want and tell it whether you want to the data to be saved in your terminal or to a file. The complexity increases when you have to interact with a site that requires authentication or with an API, but once you learn the curl command syntax, it becomes second nature. To help you get the hang of it, we collected the pertinent syntax information in a handy cheat sheet .

Download a file with curl

You can download a file with the  curl  command by providing a link to a specific URL. If you provide a URL that defaults to index.html , then the index page is downloaded, and the file you downloaded is displayed on your terminal screen. You can pipe the output to less or tail or any other command:

Because some URLs contain special characters that your shell normally interprets, it's safest to surround your URL in quotation marks.

Some files don't translate well to being displayed in a terminal. You can use the --remote-name option to cause the file to be saved according to what it's called on the server:

Alternatively, you can use the --output option to name your download whatever you want:

List contents of a remote directory with curl

Because curl is non-interactive, it's difficult to browse a page for downloadable elements. Provided that the remote server you're connecting to allows it, you can use curl to list the contents of a directory:

Continue a partial download

If you're downloading a very large file, you might find that you have to interrupt the download. Curl is intelligent enough to determine where you left off and continue the download. That means the next time you're downloading a 4GB Linux distribution ISO and something goes wrong, you never have to go back to the start. The syntax for --continue-at is a little unusual: if you know the byte count where your download was interrupted, you can provide it; otherwise, you can use a lone dash ( - ) to tell curl to detect it automatically:

Download a sequence of files

If you need to download several files—rather than just one big file—curl can help with that. Assuming you know the location and file-name pattern of the files you want to download, you can use curl's sequencing notation: the start and end point between a range of integers, in brackets. For the output filename, use #1 to indicate the first variable:

If you need to use another variable to represent another sequence, denote each variable in the order it appears in the command. For example, in this command, #1 refers to the directories images_000 through images_009 , while #2 refers to the files file_1.webp through file_4.webp :

Download all PNG files from a site

You can do some rudimentary web scraping to find what you want to download, too, using only curl and grep . For instance, say you need to download all images associated with a web page you're archiving. First, download the page referencing the images. Pipe the page to grep with a search for the image type you're targeting (PNG in this example). Finally, create a while loop to construct a download URL and to save the files to your computer:

This is just an example, but it demonstrates how flexible curl can be when combined with a Unix pipe and some clever, but basic, parsing.

Fetch HTML headers

Protocols used for data exchange have a lot of metadata embedded in the packets that computers send to communicate. HTTP headers are components of the initial portion of data. It can be helpful to view these headers (especially the response code) when troubleshooting your connection to a site:

Fail quickly

A 200 response is the usual HTTP indicator of success, so it's what you usually expect when you contact a server. The famous 404 response indicates that a page can't be found, and 500 means there was a server error.

To see what errors are happening during negotiation, add the --show-error flag:

These can be difficult for you to fix unless you have access to the server you're contacting, but curl generally tries its best to resolve the location you point it to. Sometimes when testing things over a network, seemingly endless retries just waste time, so you can force curl to exit upon failure quickly with the --fail-early option:

Redirect query as specified by a 3xx response

The 300 series of responses, however, are more flexible. Specifically, the 301 response means that a URL has been moved permanently to a different location. It's a common way for a website admin to relocate content while leaving a "trail" so people visiting the old location can still find it. Curl doesn't follow a 301 redirect by default, but you can make it continue on to a 301 destination by using the --location option:

Expand a shortened URL

The --location option is useful when you want to look at shortened URLs before visiting them. Shortened URLs can be useful for social networks with character limits (of course, this may not be an issue if you use a modern and open source social network ) or for print media in which users can't just copy and paste a long URL. However, they can also be a little dangerous because their destination is, by nature, concealed. By combining the --head option to view just the HTTP headers and the --location option to unravel the final destination of a URL, you can peek into a shortened URL without loading the full resource:

Download our curl cheat sheet

Once you practice thinking about the process of exploring the web as a single command, curl becomes a fast and efficient way to pull the information you need from the internet without bothering with a graphical interface. To help you build it into your usual workflow, we've created a curl cheat sheet with common curl uses and syntax, including an overview of using it to query an API.

Digital creative of a browser on the internet

Read Reddit from the Linux terminal

Take brief mental breaks from your work with Reddit client Tuir in the eleventh in our series on 20 ways to be more productive with open source in 2020.

Chat bubbles

Use this Twitter client for Linux to tweet from the terminal

Keep up with your Twitter feed without leaving the terminal by using Rainbow Stream in the tenth in our series on 20 ways to be more productive with open source in 2020.

Seth Kenlon

Related Content

Linux keys on the keyboard for a desktop computer

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

How to enter login information for a website from the linux command line

My internet connection is provided by the university. It is protected to a username/password combination. This means when I start up my computer, I have to start a web browser and open an arbitrary website. I am then redirected to a page, which (among other things) contains two forms. In these I have to input username and password. I managed to do this with firefox (which can save the password) and also with links (which loads faster and from the command line).

Is there any way to automate the login process using a bash script? This would allow doing the login when booting, so that it is already there when I start the X server.

  • command-line

Tim's user avatar

  • 1 You might be able to call the login script from the form's ACTION attribute with curl directly. –  terdon Sep 4, 2013 at 12:56
  • Many Universities also offer a network that uses "Enterprise Authentication" (i.e. using a username/password for the network connection itself, instead of waiting until you try to access a page to ask for credentials). The ability to store such network credentials is built in the OS. It's also much more secure because it means that it's harder for others to snoop on your connection. If your University supports that, you should switch to it. –  Moshe Katz Sep 9, 2013 at 19:58
  • It would also help us if you can give an (anonymized) example of the URL you are redirected to when you log in. (Anonymized here means that you should remove your MAC Address and/or IP address from the URL if they are there, but leave everything else, including the name of the University.) –  Moshe Katz Sep 9, 2013 at 20:03

6 Answers 6

You can try it out with curl , you can Simply use curl like this to login to web page :

You can pass Data to website like this from Stackoverflow answer

you need cookies if you want to make another curl request after logging in. the session id in cookies will help next curl request authorized.

If you don't want cookies you can use

You can additionally refer here for Special Commands

Community's user avatar

  • 1 I am not able to try this right now, but I expect that this will only work when there is a dialog box asking for the password when opening the site. In my case there are just two forms. One for the name and one for the password. I will change the question to make this clearer. –  Tim Sep 4, 2013 at 12:33
  • @Tim added how to pass data,normally You would need to find out what page the page requests to (or the action value of the page). –  BlueBerry - Vignesh4303 Sep 4, 2013 at 14:03
  • This sounded as if it could work, but sadly it didn't. When looking at the output of curl suggests that the Username field is correctly filled with the correct value, but the Password field is not (this may be correct as a security measure). I am not sure if the submit button was actually triggered. Does it matter what value is passed to Login ? –  Tim Sep 6, 2013 at 14:07

I finally found a way to automatically log in using elinks . It works and it is even easy to configure!

Two options need to be set. This can done by adding the following lines in ~/.elinks/elinks.conf (if the file is not there, create one) or by changing the values at the respective positions in the options dialog within elinks :

Steps for a scriptable autologin are then:

  • Set those two options
  • Open the login page in elinks , fill the forms and submit them.
  • Choose to remember name and password for later use.
  • Close elinks
  • Run elinks -auto-submit http://somesite.com

The latter command should perform the automatic login without further user interaction.

I actually use timeout 1m elinks -auto-submit http://somesite.com & , so that I do not have an idling elinks process running in the background all the time.

Uttam Pal's user avatar

A simple way to script this is with Selenium .

You can use their Firefox "Test Recorder" plugin to record a test of yourself logging in to the network, and then play back the test.

Moshe Katz's user avatar

Yes, there is a very simple way to login to your university's internet.You can use the ' Lynx ' web browser which is a text-based browser, designed for use on terminal. So, here is the way:

where, ' username ' is the name of the field corresponding to the user name in the form and ' password ' is the name of the field corresponding to the password field and ' myname ' and ' mypassword ' are the corresponding values to be filled in the form. You can find field name by using 'Inspect Element' from any browser. I tried with curl as directed in the answer by BlueBerry - Vignesh4303 but didn't work.

Kushagra Sharma's user avatar

You can get an add-on for your browser which will auto log-in to websites with saved passwords. I used AutoAuth with firefox. Then you login once and save your credentials, then write a script that just has

When executed, it will go and auto login. I tried with multiple sites and it worked well.

myfavoritenoisemaker's user avatar

to access quicker to your login url web without remembering username or password

#make a script below

echo "username" |xclip -sel clip |chromium-browser (input url address for login here https://...)

echo "password" |xclip -sel clip

Explanation of the script above

echo "username" |xclip -sel clip <-- will copy to clipboard your username

.... |chromium-browser` (input url address for login https://...) <-- the second part of the first line will open the login url https://.... in the chromium browser.

or open with another version of google chrome browser use below command:

google-chrome (input url address for login https://...)

to open in firefox

firefox (input url address for login https://...)

  • sleep 5 <------ will wait for 5 seconds until execute the next command

In sleep 5 seconds can be arrange longer if the usual login loading in browser will take more than 5 seconds

  • echo "password" |xclip -sel clip <---- will copy the password in clipboard

So When the command is executed:

it will copy username in the clipboard

will open the url login to the browser

if cursor already in the login box, press in keyboard Ctrl-v to paste the username

wait for 5 seconds (usually i count 1, 2, 3 .. to 10)

tab to the password box and Ctrl-V will input the password

press enter to login.

To make it simple you can separately make a script for the copy to clipboard command as explain on my other tutorial below.

https://hopelinux.blogspot.com/2022/05/copy-to-clipboard-from-command-line.html

Joe Jacobs's user avatar

  • Hi @Joe. Welcome to superuser. It is generally not a good idea, to pass around passwords via the shell (in this case even using echo ). All other processes and users can see them e.g. via top or ps without needing special permissions. The clipboard can also be easily monitored from other programs... –  Tim May 16, 2022 at 9:38

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged linux command-line bash login website ..

  • The Overflow Blog
  • Diverting more backdoor disasters
  • How to succeed as a data engineer without the burnout
  • Featured on Meta
  • New Focus Styles & Updated Styling for Button Groups
  • Upcoming initiatives on Stack Overflow and across the Stack Exchange network
  • Google Cloud will be Sponsoring Super User SE

Hot Network Questions

  • Can a firmware upgrade take away the ability to unlock a bootloader?
  • Looking for a movie or made for tv film or miniseries that I saw in the 80s. Featuring VR and the decline of humanity
  • Is this a photo of a historical reinactment of an 1868 treaty signing?
  • Do we understand chemistry from particle physics?
  • Is there a report that shows what is duplicated between contacts ? For example: contacts sharing an email, or a phone number
  • Make a square table top with the minimal needed amount of straight cuts
  • Return current on PCB
  • Does scouring a stainless-steel pan cause it to release metals into food?
  • Why aren't there kamikaze warp bombs?
  • What is the first Sci-Fi/Fantasy film to include adverts for fake films with real actors?
  • Separating Gamma in two independent functions
  • How do you measure specific impulse Isp of a rocket engine?
  • When is it important for a practitioner to understand CIs?
  • Looking for Short Story in Magazine: Researcher living in his Computer simulation
  • ER diagram with empty boxes as a worksheet
  • What are some good examples of spectral sequences which degenerate after the first nontrivial differential?
  • What does one call the left and right sides of a building, in order to fix a point of view?
  • Why isn't work a state function?
  • Will nothing bad happen if I just create infinite energy?
  • Ways to Say "Forcibly Inducted"
  • To what extent can US police lie to a suspect?
  • Why is the general term of the sequence obtained using the RSolve function incorrect? Could it be a bug?
  • Why is there a year 1 B.C., a year 0, and a year 1 A.D. in NASA’s Five Millennium Canon of Solar Eclipses?
  • Why does microwave take more time to heat more food?

linux command visit website

  • :(){ :|:& };:
  • for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l 2>/dev/null; done
  • file=$(echo `basename "$file"`)
  • true && { echo success; } || { echo failed; }
  • cut -d ' ' -f 1 /var/log/apache2/access_logs | uniq -c | sort -n
  • tar zcf - some-dir | ssh some-server "cd /; tar xvzf -"
  • tar xzvf archive.tar.gz
  • find . -type f -print0
  • ssh -i keyfile -f -N -L 1234:www.google.com:80 host
  • git log --graph --abbrev-commit --pretty=oneline origin..mybranch

It's FOSS

You can Surf Internet in Linux Terminal With These Command Line Browsers

Ankush Das

I’m guessing that you are probably using Firefox or a Chrome-based browser like Brave to read this article. Or, maybe, Google Chrome or Chromium or other web browsers available for Linux .

In other words, you are utilizing a GUI-based approach to browse the web. However, back in the days, people used the terminal to fetch resources and browse the web because everything was mostly text-based information.

Even though you cannot get every information from a terminal now, you can still try the command line browsers for some text-based information and open a web page from the Linux terminal.

Not just limited to that, but if you are accessing a remote server or stuck in a terminal without a GUI, a terminal web browser can prove to be useful as well.

So, in this article, I will be mentioning some terminal based web browsers that you can try on Linux.

Note: The list is in no particular order of ranking.

W3m Google

w3m is a popular open-source text-based web browser for the terminal. Even though the original project is no longer active, an active version of it is being maintained by a different developer Tatsuya Kinoshita.

w3m is quite simple, supports SSL connections, colors, and in-line images as well. Of course, depending on what resource you are trying to access, things might look different on your end. As per my quick test, it didn’t seem to load up DuckDuckGo but I could use Google in terminal just fine.

You can simply type w3m in the terminal to get help after installation. If you’re curious, you can also check out the repository at GitHub .

How to install and use w3m?

W3M is available on most of the default repositories for any Debian-based Linux distribution. If you have an Arch-based distro, you might want to check AUR if it’s not available directly.

For Ubuntu, you can install it by typing in:

Here, we are installing the w3m package along with image extension for in-line image support. Next, to get started, you have to simply follow the command below:

Of course, you need to replace xyz.com to any website that you want to browse/test. Finally, you should know that you can use the keyboard arrow keys to navigate and press enter when you want to take an action.

To quit, you can press SHIFT+Q , and to go back to the previous page — SHIFT+B . Additional shortcuts include SHIFT + T to open a new tab and SHIFT + U to open a new URL. You can explore more about it by heading to its man page as well.

Lynx Terminal

Lynx is yet another open source command line browser which you can try. Fortunately, more websites tend to work when using Lynx, so I’d say it is definitely better in that aspect. I was able to load up DuckDuckGo and make it work.

In addition to that, I also noticed that it lets you accept/deny cookies when visiting various web resources. You can set it to always accept or deny as well. So, that’s a good thing.

On the other hand, the window does not re-size well while using it from the terminal. I haven’t looked for any solutions to that, so if you’re trying this out, you might want to do that. In either case, it works great and you get all the instructions for the keyboard shortcuts right when you launch it in the terminal.

Note that it does not match the system terminal theme, so it will look different no matter how your terminal looks like.

How to install Lynx?

Unlike w3m, you do get some Win32 installers if you’re interested to try. But, on Linux, it is available on the most of the default repositories.

For Ubuntu, you just need to type in:

To get started, you just have to follow the command below:

Here, you just need to replace the example website with the resource you want to visit.

If you want to explore the packages for other Linux distros, you can check out their official website resources .

Links2 Terminal

Links2 is an interesting text-based browser that you can easily utilize on your terminal with a good user experience. It gives you a nice interface to type in the URL and then proceed as soon as you launch it.

Links2 Terminal Welcome

It is worth noting that the theme will depend on your terminal settings, I have it set as “black-green”, hence this is what you see. Once you launch it as a command line browser, you just need to press any key to bring the URL prompt or Q to quit it. It works good enough and renders text from most of the sites.

Unlike Lynx, you do not get the ability to accept/reject cookies. Other than that, it seems to work just fine.

How to install Links2?

As you’d expect, you will find it available in the most of the default repositories. For Ubuntu, you can install it by typing the following command in the terminal:

You can refer to its official website for packages or documentations if you want to install it on any other Linux distribution.

Elinks Terminal

eLinks is similar to Links2 — but it is no longer maintained. You will still find it in the default repositories of various distributions, hence, I kept it in this list.

It does not blend in with your system terminal theme. So, this may not be a pretty experience as a text-based browser without a “dark” mode if you needed that.

How to install eLinks?

On Ubuntu, it is easy to install it. You just have to type in the following in the terminal:

For other Linux distributions, you should find it available on the standard repositories. But, you can refer to the official installation instructions if you do not find it in the repository.

More such terminal stuff

It’s no surprise that there aren’t a lot of text-based web browsers to run on the terminal. Some projects like Browsh have tried to present a modern Linux command-line browser but it did not work in my case.

While tools like curl and wget allow you to download files from the Linux command line , these terminal-based web browsers provide additional features.

linux command visit website

In addition to command-line browsers, you may also like to try some command line games for Linux , if you want to play around in the terminal.

linux command visit website

Browsing web in the Linux terminal or using the Linux terminal in a web browser , you can do it all.

What do you think about the text-based web browsers for Linux terminal? Feel free to let me know your thoughts in the comments below.

A passionate technophile who also happens to be a Computer Science graduate. You will usually see cats dancing to the beautiful tunes sung by him.

Check File Size in Linux Command Line

Open source video converters for linux [gui and cli], best daw (digital audio workstation) available for linux desktops, 11 free and open source video editing software, best audio editors for linux, it's foss.

Making You a Better Linux User

It's FOSS

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Your link has expired.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.

The Linux Command Handbook – Learn Linux Commands for Beginners

Flavio Copes

This Linux Command Handbook will cover 60 core Bash commands you will need as a developer. Each command includes example code and tips for when to use it.

This Linux Command Handbook follows the 80/20 rule: you'll learn 80% of a topic in around 20% of the time you spend studying it.

I find that this approach gives you a well-rounded overview.

This handbook does not try to cover everything under the sun related to Linux and its commands. It focuses on the small core commands that you will use the 80% or 90% of the time, and tries to simplify the usage of the more complex ones.

All these commands work on Linux, macOS, WSL, and anywhere you have a UNIX environment.

I hope the contents of this handbook will help you achieve what you want: getting comfortable with Linux .

You can bookmark this page in your browser so you can reference this handbook in the future.

And you can download this handbook in PDF / ePUB / Mobi format for free .

Table of Contents

Introduction to linux and shells, the linux man command, the linux ls command, the linux cd command, the linux pwd command, the linux mkdir command, the linux rmdir command, the linux mv command, the linux cp command, the linux open command, the linux touch command, the linux find command, the linux ln command, the linux gzip command, the linux gunzip command, the linux tar command, the linux alias command, the linux cat command, the linux less command, the linux tail command, the linux wc command, the linux grep command, the linux sort command, the linux uniq command, the linux diff command, the linux echo command, the linux chown command, the linux chmod command, the linux umask command, the linux du command, the linux df command, the linux basename command, the linux dirname command, the linux ps command, the linux top command, the linux kill command, the linux killall command, the linux jobs command, the linux bg command, the linux fg command, the linux type command, the linux which command, the linux nohup command, the linux xargs command, the linux vim editor command, the linux emacs editor command, the linux nano editor command, the linux whoami command, the linux who command, the linux su command, the linux sudo command, the linux passwd command, the linux ping command, the linux traceroute command, the linux clear command, the linux history command, the linux export command, the linux crontab command, the linux uname command, the linux env command, the linux printenv command, what is linux.

Linux is an operating system, like macOS or Windows.

It is also the most popular Open Source operating system, and it gives you a lot of freedom.

It powers the vast majority of the servers that compose the Internet. It's the base upon which everything is built. But not just that. Android is based on (a modified version of) Linux.

The Linux "core" (called a kernel ) was born in 1991 in Finland, and it has come a really long way from its humble beginnings. It went on to be the kernel of the GNU Operating System, creating the duo GNU/Linux.

There's one thing about Linux that corporations like Microsoft, Apple, and Google will never be able to offer: the freedom to do whatever you want with your computer.

They're actually going in the opposite direction, building walled gardens, especially on the mobile side.

Linux is the ultimate freedom.

It is developed by volunteers, some paid by companies that rely on it, some independently. But there's no single commercial company that can dictate what goes into Linux, or the project's priorities.

You can also use Linux as your day to day computer. I use macOS because I really enjoy the applications and design (and I also used to be an iOS and Mac apps developer). But before using macOS I used Linux as my main computer Operating System.

No one can dictate which apps you can run, or "call home" with apps that track you, your position, and more.

Linux is also special because there's not just "one Linux", like is the case with Windows or macOS. Instead, we have distributions .

A "distro" is made by a company or organization and packages the Linux core with additional programs and tooling.

For example you have Debian, Red Hat, and Ubuntu, probably the most popular distributions.

But many, many more exist. You can create your own distribution, too. But most likely you'll use a popular one that has lots of users and a community of people around it. This lets you do what you need to do without losing too much time reinventing the wheel and figuring out answers to common problems.

Some desktop computers and laptops ship with Linux preinstalled. Or you can install it on your Windows-based computer, or on a Mac.

But you don't need to disrupt your existing computer just to get an idea of how Linux works.

I don't have a Linux computer.

If you use a Mac, you just need to know that under the hood macOS is a UNIX Operating System. It shares a lot of the same ideas and software that a GNU/Linux system uses, because GNU/Linux is a free alternative to UNIX.

UNIX is an umbrella term that groups many operating systems used in big corporations and institutions, starting from the 70's

The macOS terminal gives you access to the same exact commands I'll describe in the rest of this handbook.

Microsoft has an official Windows Subsystem for Linux which you can (and should!) install on Windows. This will give you the ability to run Linux in a very easy way on your PC.

But the vast majority of the time you will run a Linux computer in the cloud via a VPS (Virtual Private Server) like DigitalOcean.

What is a Linux shell?

A shell is a command interpreter that exposes an interface to the user to work with the underlying operating system.

It allows you to execute operations using text and commands, and it provides users advanced features like being able to create scripts.

This is important: shells let you perform things in a more optimized way than a GUI (Graphical User Interface) could ever possibly let you do. Command line tools can offer many different configuration options without being too complex to use.

There are many different kind of shells. This post focuses on Unix shells, the ones that you will find commonly on Linux and macOS computers.

Many different kind of shells were created for those systems over time, and a few of them dominate the space: Bash, Csh, Zsh, Fish and many more!

All shells originate from the Bourne Shell, called sh . "Bourne" because its creator was Steve Bourne.

Bash means Bourne-again shell . sh was proprietary and not open source, and Bash was created in 1989 to create a free alternative for the GNU project and the Free Software Foundation. Since projects had to pay to use the Bourne shell, Bash became very popular.

If you use a Mac, try opening your Mac terminal. By default it runs ZSH (or, pre-Catalina, Bash).

You can set up your system to run any kind of shell – for example I use the Fish shell.

Each single shell has its own unique features and advanced usage, but they all share a common functionality: they can let you execute programs, and they can be programmed.

In the rest of this handbook we'll see in detail the most common commands you will use.

The first command I'll introduce will help you understand all the other commands.

Every time I don't know how to use a command, I type man <command> to get the manual:

Screen-Shot-2020-07-04-at-18.42.40

This is a man (from _manual_ ) page. Man pages are an essential tool to learn as a developer. They contain so much information that sometimes it's almost too much. The above screenshot is just 1 of 14 screens of explanation for the ls command.

Most of the time when I need to learn a command quickly I use this site called tldr pages : https://tldr.sh . It's a command you can install, which you then run like this: tldr <command> . It gives you a very quick overview of a command, with some handy examples of common usage scenarios:

Screen-Shot-2020-09-07-at-07.35.41

This is not a substitute for man , but a handy tool to avoid losing yourself in the huge amount of information present in a man page. Then you can use the man page to explore all the different options and parameters you can use on a command.

Inside a folder you can list all the files that the folder contains using the ls command:

If you add a folder name or path, it will print that folder's contents:

Screenshot-2019-02-09-at-18.50.14

ls accepts a lot of options. One of my favorite combinations is -al . Try it:

Screenshot-2019-02-09-at-18.49.52

Compared to the plain ls command, this returns much more information.

You have, from left to right:

  • the file permissions (and if your system supports ACLs, you get an ACL flag as well)
  • the number of links to that file
  • the owner of the file
  • the group of the file
  • the file size in bytes
  • the file's last modified datetime
  • the file name

This set of data is generated by the l option. The a option instead also shows the hidden files.

Hidden files are files that start with a dot ( . ).

Once you have a folder, you can move into it using the cd command. cd means c hange d irectory. You invoke it specifying a folder to move into. You can specify a folder name, or an entire path.

Now you are in the fruits folder.

You can use the .. special path to indicate the parent folder:

The # character indicates the start of the comment, which lasts for the entire line after it's found.

You can use it to form a path:

There is another special path indicator which is . , and indicates the current folder.

You can also use absolute paths, which start from the root folder / :

Whenever you feel lost in the filesystem, call the pwd command to know where you are:

It will print the current folder path.

You create folders using the mkdir command:

You can create multiple folders with one command:

You can also create multiple nested folders by adding the -p option:

Options in UNIX commands commonly take this form. You add them right after the command name, and they change how the command behaves. You can often combine multiple options, too.

You can find which options a command supports by typing man <commandname> . Try now with man mkdir for example (press the q key to esc the man page). Man pages are the amazing built-in help for UNIX.

Just as you can create a folder using mkdir , you can delete a folder using rmdir :

You can also delete multiple folders at once:

The folder you delete must be empty.

To delete folders with files in them, we'll use the more generic rm command which deletes files and folders, using the -rf option:

Be careful as this command does not ask for confirmation and it will immediately remove anything you ask it to remove.

There is no bin when removing files from the command line, and recovering lost files can be hard.

Once you have a file, you can move it around using the mv command. You specify the file current path, and its new path:

The pear file is now moved to new_pear . This is how you rename files and folders.

If the last parameter is a folder, the file located at the first parameter path is going to be moved into that folder. In this case, you can specify a list of files and they will all be moved in the folder path identified by the last parameter:

You can copy a file using the cp command:

To copy folders you need to add the -r option to recursively copy the whole folder contents:

The open command lets you open a file using this syntax:

You can also open a directory, which on macOS opens the Finder app with the current directory open:

I use it all the time to open the current directory:

The special . symbol points to the current directory, as .. points to the parent directory

The same command can also be be used to run an application:

You can create an empty file using the touch command:

If the file already exists, it opens the file in write mode, and the timestamp of the file is updated.

The find command can be used to find files or folders matching a particular search pattern. It searches recursively.

Let's learn how to use it by example.

Find all the files under the current tree that have the .js extension and print the relative path of each file that matches:

It's important to use quotes around special characters like * to avoid the shell interpreting them.

Find directories under the current tree matching the name "src":

Use -type f to search only files, or -type l to only search symbolic links.

-name is case sensitive. use -iname to perform a case-insensitive search.

You can search under multiple root trees:

Find directories under the current tree matching the name "node_modules" or 'public':

You can also exclude a path using -not -path :

You can search files that have more than 100 characters (bytes) in them:

Search files bigger than 100KB but smaller than 1MB:

Search files edited more than 3 days ago:

Search files edited in the last 24 hours:

You can delete all the files matching a search by adding the -delete option. This deletes all the files edited in the last 24 hours:

You can execute a command on each result of the search. In this example we run cat to print the file content:

Notice the terminating \; . {} is filled with the file name at execution time.

The ln command is part of the Linux file system commands.

It's used to create links. What is a link? It's like a pointer to another file, or a file that points to another file. You might be familiar with Windows shortcuts. They're similar.

We have 2 types of links: hard links and soft links .

Hard links are rarely used. They have a few limitations: you can't link to directories, and you can't link to external filesystems (disks).

A hard link is created using the following syntax:

For example, say you have a file called recipes.txt. You can create a hard link to it using:

The new hard link you created is indistinguishable from a regular file:

Screen-Shot-2020-09-02-at-11.26.21

Now any time you edit any of those files, the content will be updated for both.

If you delete the original file, the link will still contain the original file content, as that's not removed until there is one hard link pointing to it.

Screen-Shot-2020-09-02-at-11.26.07

Soft links are different. They are more powerful as you can link to other filesystems and to directories. But keep in mind that when the original is removed, the link will be broken.

You create soft links using the -s option of ln :

For example, say you have a file called recipes.txt. You can create a soft link to it using:

In this case you can see there's a special l flag when you list the file using ls -al . The file name has a @ at the end, and it's also colored differently if you have colors enabled:

Screen-Shot-2020-09-02-at-11.27.18

You can compress a file using the gzip compression protocol named LZ77 using the gzip command.

Here's the simplest usage:

This will compress the file, and append a .gz extension to it. The original file is deleted.

To prevent this, you can use the -c option and use output redirection to write the output to the filename.gz file:

The -c option specifies that the output will go to the standard output stream, leaving the original file intact.

Or you can use the -k option:

There are various levels of compression. The more the compression, the longer it will take to compress (and decompress). Levels range from 1 (fastest, worst compression) to 9 (slowest, better compression), and the default is 6.

You can choose a specific level with the -<NUMBER> option:

You can compress multiple files by listing them:

You can compress all the files in a directory, recursively, using the -r option:

The -v option prints the compression percentage information. Here's an example of it being used along with the -k (keep) option:

Screen-Shot-2020-09-09-at-15.55.42

The gunzip command is basically equivalent to the gzip command, except the -d option is always enabled by default.

The command can be invoked in this way:

This will gunzip and will remove the .gz extension, putting the result in the filename file. If that file exists, it will overwrite that.

You can extract to a different filename using output redirection using the -c option:

The tar command is used to create an archive, grouping multiple files in a single file.

Its name comes from the past and means tape archive (back when archives were stored on tapes).

This command creates an archive named archive.tar with the content of file1 and file2 :

The c option stands for create . The f option is used to write to file the archive.

To extract files from an archive in the current folder, use:

the x option stands for extract .

And to extract them to a specific directory, use:

You can also just list the files contained in an archive:

Screen-Shot-2020-09-09-at-16.56.33

This is done using the z option:

This is just like creating a tar archive, and then running gzip on it.

To unarchive a gzipped archive, you can use gunzip , or gzip -d , and then unarchive it. But tar -xf will recognize it's a gzipped archive, and do it for you:

It's common to always run a program with a set of options that you like using.

For example, take the ls command. By default it prints very little information:

Screen-Shot-2020-09-03-at-15.21.00

But if you use the -al option it will print something more useful, including the file modification date, the size, the owner, and the permissions. It will also list hidden files (files starting with a . ):

Screen-Shot-2020-09-03-at-15.21.08

You can create a new command, for example I like to call it ll , that is an alias to ls -al .

You do it like this:

Once you do, you can call ll just like it was a regular UNIX command:

Screen-Shot-2020-09-03-at-15.22.51

Now calling alias without any option will list the aliases defined:

Screen-Shot-2020-09-03-at-15.30.19

To make it permanent, you need to add it to the shell configuration. This could be ~/.bashrc or ~/.profile or ~/.bash_profile if you use the Bash shell, depending on the use case.

Be careful with quotes if you have variables in the command: if you use double quotes, the variable is resolved at definition time. If you use use single quotes, it's resolved at invocation time. Those 2 are different:

$PWD refers to the current folder the shell is in. If you now navigate away to a new folder, lscurrent lists the files in the new folder, whereas lsthis still lists the files in the folder where you were when you defined the alias.

Similar to tail in some ways, we have cat . Except cat can also add content to a file, and this makes it super powerful.

In its simplest usage, cat prints a file's content to the standard output:

You can print the content of multiple files:

and using the output redirection operator > you can concatenate the content of multiple files into a new file:

Using >> you can append the content of multiple files into a new file, creating it if it does not exist:

When you're looking at source code files it's helpful to see the line numbers. You can have cat print them using the -n option:

You can only add a number to non-blank lines using -b , or you can also remove all the multiple empty lines using -s .

cat is often used in combination with the pipe operator | to feed a file's content as input to another command: cat file1 | anothercommand .

The less command is one I use a lot. It shows you the content stored inside a file, in a nice and interactive UI.

Usage: less <filename> .

Screenshot-2019-02-10-at-09.11.05

Once you are inside a less session, you can quit by pressing q .

You can navigate the file contents using the up and down keys, or using the space bar and b to navigate page by page. You can also jump to the end of the file pressing G and jump back to the start by pressing g .

You can search contents inside the file by pressing / and typing a word to search. This searches forward . You can search backwards using the ? symbol and typing a word.

This command just visualises the file's content. You can directly open an editor by pressing v . It will use the system editor, which in most cases is vim .

Pressing the F key enters follow mode , or watch mode . When the file is changed by someone else, like from another program, you get to see the changes live .

This doesn't happen by default, and you only see the file version at the time you opened it. You need to press ctrl-C to quit this mode. In this case the behaviour is similar to running the tail -f <filename> command.

You can open multiple files, and navigate through them using :n (to go to the next file) and :p (to go to the previous).

The best use case of tail in my opinion is when called with the -f option. It opens the file at the end, and watches for file changes.

Any time there is new content in the file, it is printed in the window. This is great for watching log files, for example:

To exit, press ctrl-C .

You can print the last 10 lines in a file:

You can print the whole file content starting from a specific line using + before the line number:

tail can do much more and as always my advice is to check man tail .

The wc command gives us useful information about a file or input it receives via pipes.

Example via pipes, we can count the output of running the ls -al command:

The first column returned is the number of lines. The second is the number of words. The third is the number of bytes.

We can tell it to just count the lines:

or just the words:

or just the bytes:

Bytes in ASCII charsets equate to characters. But with non-ASCII charsets, the number of characters might differ because some characters might take multiple bytes (for example this happens in Unicode).

In this case the -m flag will help you get the correct value:

The grep command is a very useful tool. When you master it, it will help you tremendously in your day to day coding.

If you're wondering, grep stands for global regular expression print .

You can use grep to search in files, or combine it with pipes to filter the output of another command.

For example here's how we can find the occurences of the document.getElementById line in the index.md file:

Screen-Shot-2020-09-04-at-09.42.10

Using the -n option it will show the line numbers:

Screen-Shot-2020-09-04-at-09.47.04

One very useful thing is to tell grep to print 2 lines before and 2 lines after the matched line to give you more context. That's done using the -C option, which accepts a number of lines:

Screen-Shot-2020-09-04-at-09.44.35

Search is case sensitive by default. Use the -i flag to make it insensitive.

As mentioned, you can use grep to filter the output of another command. We can replicate the same functionality as above using:

Screen-Shot-2020-09-04-at-09.43.15

The search string can be a regular expression, and this makes grep very powerful.

Another thing you might find very useful is to invert the result, excluding the lines that match a particular string, using the -v option:

Screen-Shot-2020-09-04-at-09.42.04

Suppose you have a text file which contains the names of dogs:

Screen-Shot-2020-09-07-at-07.56.28

This list is unordered.

The sort command helps you sort them by name:

Screen-Shot-2020-09-07-at-07.57.08

Use the r option to reverse the order:

Screen-Shot-2020-09-07-at-07.57.28

Sorting by default is case sensitive, and alphabetic. Use the --ignore-case option to sort case insensitive, and the -n option to sort using a numeric order.

If the file contains duplicate lines:

Screen-Shot-2020-09-07-at-07.59.03

You can use the -u option to remove them:

Screen-Shot-2020-09-07-at-07.59.16

sort does not just work on files, as many UNIX commands do – it also works with pipes. So you can use it on the output of another command. For example you can order the files returned by ls with:

sort is very powerful and has lots more options, which you can explore by calling man sort .

Screen-Shot-2020-09-07-at-08.01.27

uniq is a command that helps you sort lines of text.

You can get those lines from a file, or using pipes from the output of another command:

You need to consider this key thing: uniq will only detect adjacent duplicate lines.

This implies that you will most likely use it along with sort :

The sort command has its own way to remove duplicates with the -u ( unique ) option. But uniq has more power.

By default it removes duplicate lines:

Screen-Shot-2020-09-07-at-08.39.35

You can tell it to only display duplicate lines, for example, with the -d option:

Screen-Shot-2020-09-07-at-08.36.50

You can use the -u option to only display non-duplicate lines:

Screen-Shot-2020-09-07-at-08.38.50

You can count the occurrences of each line with the -c option:

Screen-Shot-2020-09-07-at-08.37.15

Use the special combination:

to then sort those lines by most frequent:

Screen-Shot-2020-09-07-at-08.37.49

diff is a handy command. Suppose you have 2 files, which contain almost the same information, but you can't find the difference between the two.

diff will process the files and will tell you what's the difference.

Suppose you have 2 files: dogs.txt and moredogs.txt . The difference is that moredogs.txt contains one more dog name:

Screen-Shot-2020-09-07-at-08.55.18

diff dogs.txt moredogs.txt will tell you the second file has one more line, line 3 with the line Vanille :

Screen-Shot-2020-09-07-at-08.56.05

If you invert the order of the files, it will tell you that the second file is missing line 3, whose content is Vanille :

Screen-Shot-2020-09-07-at-08.56.10

Using the -y option will compare the 2 files line by line:

Screen-Shot-2020-09-07-at-08.57.56

The -u option however will be more familiar to you, because that's the same used by the Git version control system to display differences between versions:

Screen-Shot-2020-09-07-at-08.58.23

Comparing directories works in the same way. You must use the -r option to compare recursively (going into subdirectories):

Screen-Shot-2020-09-07-at-09.01.07

In case you're interested in which files differ, rather than the content, use the r and q options:

Screen-Shot-2020-09-07-at-09.01.30

There are many more options you can explore in the man page by running man diff :

Screen-Shot-2020-09-07-at-09.02.32

The echo command does one simple job: it prints to the output the argument passed to it.

This example:

will print hello to the terminal.

We can append the output to a file:

We can interpolate environment variables:

Screen-Shot-2020-09-03-at-15.44.33

Beware that special characters need to be escaped with a backslash \ . $ for example:

Screen-Shot-2020-09-03-at-15.51.18

We can echo the files in the current folder:

We can echo the files in the current folder that start with the letter o :

Any valid Bash (or any shell you are using) command and feature can be used here.

You can print your home folder path:

Screen-Shot-2020-09-03-at-15.46.36

You can also execute commands, and print the result to the standard output (or to file, as you saw):

Screen-Shot-2020-09-03-at-15.48.55

Note that whitespace is not preserved by default. You need to wrap the command in double quotes to do so:

Screen-Shot-2020-09-03-at-15.49.53

You can generate a list of strings, for example ranges:

Screen-Shot-2020-09-03-at-15.47.19

Every file/directory in an Operating System like Linux or macOS (and every UNIX system in general) has an owner .

The owner of a file can do everything with it. It can decide the fate of that file.

The owner (and the root user) can change the owner to another user, too, using the chown command:

For example if you have a file that's owned by root , you can't write to it as another user:

Screen-Shot-2020-09-03-at-18.40.49

You can use chown to transfer the ownership to you:

Screen-Shot-2020-09-03-at-18.40.58

You can do so using the -R flag:

Files/directories don't just have an owner, they also have a group . Through this command you can change that simultaneously while you change the owner:

You can also just change the group of a file using the chgrp command:

Every file in the Linux / macOS Operating Systems (and UNIX systems in general) has 3 permissions: read, write, and execute.

Go into a folder, and run the ls -al command.

Screen-Shot-2020-09-03-at-18.49.22

Let's dissect it.

The first letter indicates the type of file:

  • - means it's a normal file
  • d means it's a directory
  • l means it's a link

Then you have 3 sets of values:

  • The first set represents the permissions of the owner of the file
  • The second set represents the permissions of the members of the group the file is associated to
  • The third set represents the permissions of the everyone else

Those sets are composed by 3 values. rwx means that specific persona has read, write and execution access. Anything that is removed is swapped with a - , which lets you form various combinations of values and relative permissions: rw- , r-- , r-x , and so on.

You can change the permissions given to a file using the chmod command.

chmod can be used in 2 ways. The first is using symbolic arguments, the second is using numeric arguments. Let's start with symbols first, which is more intuitive.

You type chmod followed by a space, and a letter:

  • a stands for all
  • u stands for user
  • g stands for group
  • o stands for others

Then you type either + or - to add a permission, or to remove it. Then you enter one or more permission symbols ( r , w , x ).

All followed by the file or folder name.

Here are some examples:

You can apply the same permissions to multiple personas by adding multiple letters before the + / - :

In case you are editing a folder, you can apply the permissions to every file contained in that folder using the -r (recursive) flag.

Numeric arguments are faster but I find them hard to remember when you are not using them day to day. You use a digit that represents the permissions of the persona. This number value can be a maximum of 7, and it's calculated in this way:

  • 1 if has execution permission
  • 2 if has write permission
  • 4 if has read permission

This gives us 4 combinations:

  • 0 no permissions
  • 1 can execute
  • 2 can write
  • 3 can write, execute
  • 5 can read, execute
  • 6 can read, write
  • 7 can read, write and execute

We use them in pairs of 3, to set the permissions of all the 3 groups altogether:

When you create a file, you don't have to decide permissions up front. Permissions have defaults.

Those defaults can be controlled and modified using the umask command.

Typing umask with no arguments will show you the current umask, in this case 0022 :

Screen-Shot-2020-09-04-at-09.04.19

What does 0022 mean? That's an octal value that represents the permissions.

Another common value is 0002 .

Use umask -S to see a human-readable notation:

Screen-Shot-2020-09-04-at-09.08.18

Other users belonging to the same group ( g ) have read and execution permission, same as all the other users ( o ).

In the numeric notation, we typically change the last 3 digits.

Here's a list that gives a meaning to the number:

  • 0 read, write, execute
  • 1 read and write
  • 2 read and execute
  • 3 read only
  • 4 write and execute
  • 5 write only
  • 6 execute only
  • 7 no permissions

Note that this numeric notation differs from the one we use in chmod .

We can set a new value for the mask setting the value in numeric format:

or you can change a specific role's permission:

The du command will calculate the size of a directory as a whole:

Screen-Shot-2020-09-04-at-08.11.30

The 32 number here is a value expressed in bytes.

Running du * will calculate the size of each file individually:

Screen-Shot-2020-09-04-at-08.12.35

You can set du to display values in MegaBytes using du -m , and GigaBytes using du -g .

The -h option will show a human-readable notation for sizes, adapting to the size:

Screen-Shot-2020-09-04-at-08.14.40

Adding the -a option will print the size of each file in the directories, too:

Screen-Shot-2020-09-04-at-08.20.12

A handy thing is to sort the directories by size:

and then piping to head to only get the first 10 results:

Screen-Shot-2020-09-04-at-08.22.25

The df command is used to get disk usage information.

Its basic form will print information about the volumes mounted:

Screen-Shot-2020-09-08-at-08.40.39

Using the -h option ( df -h ) will show those values in a human-readable format:

Screen-Shot-2020-09-08-at-08.40.50

You can also specify a file or directory name to get information about the specific volume it lives on:

Screen-Shot-2020-09-08-at-08.41.27

Suppose you have a path to a file, for example /Users/flavio/test.txt .

will return the test.txt string:

Screen-Shot-2020-09-10-at-08.27.52

If you run basename on a path string that points to a directory, you will get the last segment of the path. In this example, /Users/flavio is a directory:

Screen-Shot-2020-09-10-at-08.28.11

will return the /Users/flavio string:

Screen-Shot-2020-09-10-at-08.31.08-1

Your computer is running tons of different processes at all times.

You can inspect them all using the ps command:

Screen-Shot-2020-09-02-at-12.25.08

This is the list of user-initiated processes currently running in the current session.

Here I have a few fish shell instances, mostly opened by VS Code inside the editor, and an instance of Hugo running the development preview of a site.

Those are just the commands assigned to the current user. To list all processes we need to pass some options to ps .

The most common one I use is ps ax :

Screen-Shot-2020-09-02-at-12.26.00

The a option is used to also list other users' processes, not just your own. x shows processes not linked to any terminal (not initiated by users through a terminal).

As you can see, the longer commands are cut. Use the command ps axww to continue the command listing on a new line instead of cutting it:

Screen-Shot-2020-09-02-at-12.30.22

We need to specify w 2 times to apply this setting (it's not a typo).

You can search for a specific process combining grep with a pipe, like this:

Screen-Shot-2020-09-02-at-12.33.45

The first information is PID , the process ID. This is key when you want to reference this process in another command, for example to kill it.

Then we have TT that tells us the terminal id used.

Then STAT tells us the state of the process:

I a process that is idle (sleeping for longer than about 20 seconds) R a runnable process S a process that is sleeping for less than about 20 seconds T a stopped process U a process in uninterruptible wait Z a dead process (a zombie )

If you have more than one letter, the second represents further information, which can be very technical.

It's common to have + which indicates that the process is in the foreground in its terminal. s means the process is a session leader .

TIME tells us how long the process has been running.

The top command is used to display dynamic real-time information about running processes in the system.

It's really handy to understand what is going on.

Its usage is simple – you just type top , and the terminal will be fully immersed in this new view:

Screen-Shot-2020-09-03-at-11.39.53

There's a lot of information being given to us: the number of processes, how many are running or sleeping, the system load, the CPU usage, and a lot more.

Below, the list of processes taking the most memory and CPU is constantly updated.

By default, as you can see from the %CPU column highlighted, they are sorted by the CPU used.

You can add a flag to sort processes by memory utilized:

Linux processes can receive signals and react to them.

That's one way we can interact with running programs.

The kill program can send a variety of signals to a program.

It's not just used to terminate a program, like the name would suggest, but that's its main job.

We use it in this way:

By default, this sends the TERM signal to the process id specified.

We can use flags to send other signals, including:

HUP means hang up . It's sent automatically when a terminal window that started a process is closed before terminating the process.

INT means interrupt , and it sends the same signal used when we press ctrl-C in the terminal, which usually terminates the process.

KILL is not sent to the process, but to the operating system kernel, which immediately stops and terminates the process.

TERM means terminate . The process will receive it and terminate itself. It's the default signal sent by kill .

CONT means continue . It can be used to resume a stopped process.

STOP is not sent to the process, but to the operating system kernel, which immediately stops (but does not terminate) the process.

You might see numbers used instead, like kill -1 <PID> . In this case,

1 corresponds to HUP . 2 corresponds to INT . 9 corresponds to KILL . 15 corresponds to TERM . 18 corresponds to CONT . 15 corresponds to STOP .

Similar to the kill command, killall will send the signal to multiple processes at once instead of sending a signal to a specific process id.

This is the syntax:

where name is the name of a program. For example you can have multiple instances of the top program running, and killall top will terminate them all.

You can specify the signal, like with kill (and check the kill tutorial to read more about the specific kinds of signals we can send), for example:

When we run a command in Linux / macOS, we can set it to run in the background using the & symbol after the command.

For example we can run top in the background:

This is very handy for long-running programs.

We can get back to that program using the fg command. This works fine if we just have one job in the background, otherwise we need to use the job number: fg 1 , fg 2 and so on.

To get the job number, we use the jobs command.

Say we run top & and then top -o mem & , so we have 2 top instances running. jobs will tell us this:

Screen-Shot-2020-09-03-at-11.49.42

Running jobs -l will also print the process id of each job.

When a command is running you can suspend it using ctrl-Z .

The command will immediately stop, and you get back to the shell terminal.

You can resume the execution of the command in the background, so it will keep running but it will not prevent you from doing other work in the terminal.

In this example I have 2 commands stopped:

Screen-Shot-2020-09-03-at-16.06.18

I could have also said bg without any option, as the default is to pick the job #1 in the list.

When a command is running in the background, because you started it with & at the end (example: top & or because you put it in the background with the bg command), you can put it to the foreground using fg .

will resume in the foreground the last job that was suspended.

You can also specify which job you want to resume to the foreground passing the job number, which you can get using the jobs command.

Screen-Shot-2020-09-03-at-16.12.46

Running fg 2 will resume job #2:

Screen-Shot-2020-09-03-at-16.12.54

A command can be one of those 4 types:

  • an executable
  • a shell built-in program
  • a shell function

The type command can help figure this out, in case we want to know or we're just curious. It will tell you how the command will be interpreted.

The output will depend on the shell used. This is Bash:

Screen-Shot-2020-09-03-at-16.32.50

This is Zsh:

Screen-Shot-2020-09-03-at-16.32.57

This is Fish:

Screen-Shot-2020-09-03-at-16.33.06

Suppose you have a command you can execute, because it's in the shell path, but you want to know where it is located.

You can do so using which . The command will return the path to the command specified:

Screen-Shot-2020-09-03-at-17.22.47

Sometimes you have to run a long-lived process on a remote machine, and then you need to disconnect.

Or you simply want to prevent the command from being halted if there's any network issue between you and the server.

The way to make a command run even after you log out or close the session to a server is to use the nohup command.

Use nohup <command> to let the process continue working even after you log out.

The xargs command is used in a UNIX shell to convert input from standard input into arguments to a command.

In other words, through the use of xargs the output of a command is used as the input of another command.

Here's the syntax you will use:

We use a pipe ( | ) to pass the output to xargs . That will take care of running the command2 command, using the output of command1 as its argument(s).

Let's do a simple example. You want to remove some specific files from a directory. Those files are listed inside a text file.

We have 3 files: file1 , file2 , file3 .

In todelete.txt we have a list of files we want to delete, in this example file1 and file3 :

Screen-Shot-2020-09-08-at-07.45.28

We will channel the output of cat todelete.txt to the rm command, through xargs .

In this way:

That's the result, the files we listed are now deleted:

Screen-Shot-2020-09-08-at-07.46.39

The way it works is that xargs will run rm 2 times, one for each line returned by cat .

This is the simplest usage of xargs . There are several options we can use.

One of the most useful, in my opinion (especially when starting to learn xargs ), is -p . Using this option will make xargs print a confirmation prompt with the action it's going to take:

Screen-Shot-2020-09-08-at-08.19.09

The -n option lets you tell xargs to perform one iteration at a time, so you can individually confirm them with -p . Here we tell xargs to perform one iteration at a time with -n1 :

Screen-Shot-2020-09-08-at-08.32.58

The -I option is another widely used one. It allows you to get the output into a placeholder, and then you can do various things.

One of them is to run multiple commands:

Screen-Shot-2020-09-08-at-08.35.37

You can swap the % symbol I used above with anything else – it's a variable.

vim is a very popular file editor, especially among programmers. It's actively developed and frequently updated, and there's a big community around it. There's even a Vim conference !

vi in modern systems is just an alias for vim , which means vi i m proved.

You start it by running vi on the command line.

Screenshot-2019-02-10-at-11.44.36

You can specify a filename at invocation time to edit that specific file:

Screenshot-2019-02-10-at-11.36.21

You have to know that Vim has 2 main modes:

  • command (or normal ) mode
  • insert mode

When you start the editor, you are in command mode. You can't enter text like you expect from a GUI-based editor. You have to enter insert mode .

You can do this by pressing the i key. Once you do so, the -- INSERT -- word appears at the bottom of the editor:

Screenshot-2019-02-10-at-11.47.39

Now you can start typing and filling the screen with the file contents:

Screenshot-2019-02-10-at-11.48.39

You can move around the file with the arrow keys, or using the h - j - k - l keys. h-l for left-right, j-k for down-up.

Once you are done editing you can press the esc key to exit insert mode and go back to command mode .

Screenshot-2019-02-10-at-11.48.44

One thing you might want to do now is save the file . You can do so by pressing : (colon), then w .

You can save and quit by pressing : then w and q : :wq

You can quit without saving by pressing : then q and ! : :q!

You can undo and edit by going to command mode and pressing u . You can redo (cancel an undo) by pressing ctrl-r .

Those are the basics of working with Vim. From here starts a rabbit hole we can't go into in this little introduction.

I will only mention those commands that will get you started editing with Vim:

  • pressing the x key deletes the character currently highlighted
  • pressing A goes to the end of the currently selected line
  • press 0 to go to the start of the line
  • go to the first character of a word and press d followed by w to delete that word. If you follow it with e instead of w , the white space before the next word is preserved
  • use a number between d and w to delete more than 1 word, for example use d3w to delete 3 words forward
  • press d followed by d to delete a whole entire line. Press d followed by $ to delete the entire line from where the cursor is, until the end

To find out more about Vim I can recommend the Vim FAQ . You can also run the vimtutor command, which should already be installed in your system and will greatly help you start your vim exploration.

emacs is an awesome editor and it's historically regarded as the editor for UNIX systems. Famously, vi vs emacs flame wars and heated discussions have caused many unproductive hours for developers around the world.

emacs is very powerful. Some people use it all day long as a kind of operating system ( https://news.ycombinator.com/item?id=19127258 ). We'll just talk about the basics here.

You can open a new emacs session simply by invoking emacs :

Screenshot-2019-02-10-at-12.14.18

macOS users, stop a second now. If you are on Linux there are no problems, but macOS does not ship applications using GPLv3, and every built-in UNIX command that has been updated to GPLv3 has not been updated. While there is a little problem with the commands I listed up to now, in this case using an emacs version from 2007 is not exactly the same as using a version with 12 years of improvements and change. This is not a problem with Vim, which is up to date. To fix this, run brew install emacs and running emacs will use the new version from Homebrew (make sure you have Homebrew installed).

You can also edit an existing file by calling emacs <filename> :

Screenshot-2019-02-10-at-13.12.49

You can now start editing. Once you are done, press ctrl-x followed by ctrl-w . You confirm the folder:

Screenshot-2019-02-10-at-13.14.29

and Emacs tells you the file exists, asking you if it should overwrite it:

Screenshot-2019-02-10-at-13.14.32

Answer y , and you get a confirmation of success:

Screenshot-2019-02-10-at-13.14.35

There is a lot to know about Emacs, certainly more than I am able to write in this little introduction. I encourage you to open Emacs and press ctrl-h r to open the built-in manual and ctrl-h t to open the official tutorial.

nano is a beginner friendly editor.

Run it using nano <filename> .

You can directly type characters into the file without worrying about modes.

You can quit without editing using ctrl-X . If you edited the file buffer, the editor will ask you for confirmation and you can save the edits, or discard them.

The help at the bottom shows you the keyboard commands that let you work with the file:

Screenshot-2019-02-10-at-11.03.51

Type whoami to print the user name currently logged in to the terminal session:

Screen-Shot-2020-09-03-at-18.08.05

Note: this is different from the who am i command, which prints more information

The who command displays the users logged in to the system.

Unless you're using a server multiple people have access to, chances are you will be the only user logged in, multiple times:

Screen-Shot-2020-09-03-at-18.03.05

Why multiple times? Because each shell opened will count as an access.

You can see the name of the terminal used, and the time/day the session was started.

The -aH flags will tell who to display more information, including the idle time and the process ID of the terminal:

Screen-Shot-2020-09-03-at-18.05.29

The special who am i command will list the current terminal session details:

Screen-Shot-2020-09-03-at-18.06.35

While you're logged in to the terminal shell with one user, you might need to switch to another user.

For example you're logged in as root to perform some maintenance, but then you want to switch to a user account.

You can do so with the su command:

For example: su flavio .

If you're logged in as a user, running su without anything else will prompt you to enter the root user password, as that's the default behavior.

Screen-Shot-2020-09-03-at-18.18.09

When you're done, typing exit in the shell will close that shell, and will return you back to the current user's shell.

sudo is commonly used to run a command as root.

You must be enabled to use sudo , and once you are, you can run commands as root by entering your user's password ( not the root user password).

The permissions are highly configurable, which is great especially in a multi-user server environment. Some users can be granted access to running specific commands through sudo .

For example you can edit a system configuration file:

which would otherwise fail to save since you don't have the permissions for it.

You can run sudo -i to start a shell as root:

Screen-Shot-2020-09-03-at-18.25.50

You can use sudo to run commands as any user. root is the default, but use the -u option to specify another user:

Users in Linux have a password assigned. You can change the password using the passwd command.

There are two situations here.

The first is when you want to change your password. In this case you type:

and an interactive prompt will ask you for the old password, then it will ask you for the new one:

Screen-Shot-2020-09-04-at-07.32.05

When you're root (or have superuser privileges) you can set the username for which you want to change the password:

In this case you don't need to enter the old one.

The ping command pings a specific network host, on the local network or on the Internet.

You use it with the syntax ping <host> where <host> could be a domain name, or an IP address.

Here's an example pinging google.com :

Screen-Shot-2020-09-09-at-15.21.46

ping keeps sending the request every second, by default. It will keep running until you stop it with ctrl-C , unless you pass the number of times you want to try with the -c option: ping -c 2 google.com .

Once ping is stopped, it will print some statistics about the results: the percentage of packages lost, and statistics about the network performance.

As you can see the screen prints the host IP address, and the time that it took to get the response back.

Not all servers support pinging, in case the request times out:

Screen-Shot-2020-09-09-at-15.21.27

Sometimes this is done on purpose, to "hide" the server, or just to reduce the load. The ping packets can also be filtered by firewalls.

ping works using the ICMP protocol ( Internet Control Message Protocol ), a network layer protocol just like TCP or UDP.

The request sends a packet to the server with the ECHO_REQUEST message, and the server returns a ECHO_REPLY message. I won't go into details, but this is the basic concept.

Pinging a host is useful to know if the host is reachable (supposing it implements ping), and how distant it is in terms of how long it takes to get back to you.

Usually the nearer the server is geographically, the less time it will take to return back to you. Simple physical laws cause a longer distance to introduce more delay in the cables.

When you try to reach a host on the Internet, you go through your home router. Then you reach your ISP network, which in turn goes through its own upstream network router, and so on, until you finally reach the host.

Have you ever wanted to know what steps your packets go through to do that?

The traceroute command is made for this.

and it will (slowly) gather all the information while the packet travels.

In this example I tried reaching for my blog with traceroute flaviocopes.com :

Screen-Shot-2020-09-09-at-16.32.01

Not every router travelled returns us information. In this case, traceroute prints * * * . Otherwise, we can see the hostname, the IP address, and some performance indicator.

For every router we can see 3 samples, which means traceroute tries by default 3 times to get you a good indication of the time needed to reach it.

This is why it takes this long to execute traceroute compared to simply doing a ping to that host.

You can customize this number with the -q option:

Screen-Shot-2020-09-09-at-16.36.07

Type clear to clear all the previous commands that were run in the current terminal.

The screen will clear and you will just see the prompt at the top:

Screen-Shot-2020-09-03-at-18.10.32

Note: this command has a handy shortcut: ctrl-L

Once you do that, you will lose access to scrolling to see the output of the previous commands entered.

So you might want to use clear -x instead, which still clears the screen, but lets you go back to see the previous work by scrolling up.

Every time you run a command, it's memorized in the history.

You can display all the history using:

This shows the history with numbers:

Screen-Shot-2020-09-04-at-08.03.10

You can use the syntax !<command number> to repeat a command stored in the history. In the above example typing !121 will repeat the ls -al | wc -l command.

Typically the last 500 commands are stored in the history.

You can combine this with grep to find a command you ran:

Screen-Shot-2020-09-04-at-08.04.50

The export command is used to export variables to child processes.

What does this mean?

Suppose you have a variable TEST defined in this way:

You can print its value using echo $TEST :

Screen-Shot-2020-09-09-at-17.32.49

But if you try defining a Bash script in a file script.sh with the above command:

Screen-Shot-2020-09-09-at-17.35.23

Then when you set chmod u+x script.sh and you execute this script with ./script.sh , the echo $TEST line will print nothing!

This is because in Bash the TEST variable was defined local to the shell. When executing a shell script or another command, a subshell is launched to execute it, which does not contain the current shell local variables.

To make the variable available there we need to define TEST not in this way:

but in this way:

Try that, and running ./script.sh now should print "test":

Screen-Shot-2020-09-09-at-17.37.56

It's common to use export when you create new variables in this way. But you can also use it when you create variables in the .bash_profile or .bashrc configuration files with Bash, or in .zshenv with Zsh.

To remove a variable, use the -n option:

Calling export without any option will list all the exported variables.

Cron jobs are jobs that are scheduled to run at specific intervals. You might have a command perform something every hour, or every day, or every 2 weeks. Or on weekends.

They are very powerful, especially when used on servers to perform maintenance and automations.

The crontab command is the entry point to work with cron jobs.

The first thing you can do is to explore which cron jobs are defined by you:

You might have none, like me:

Screen-Shot-2020-09-09-at-17.54.31

to edit the cron jobs, and add new ones.

By default this opens with the default editor, which is usually vim . I like nano more. You can use this line to use a different editor:

Now you can add one line for each cron job.

The syntax to define cron jobs is kind of scary. This is why I usually use a website to help me generate it without errors: https://crontab-generator.org/

Screen-Shot-2020-09-09-at-18.03.57

You pick a time interval for the cron job, and you type the command to execute.

I chose to run a script located in /Users/flavio/test.sh every 12 hours. This is the crontab line I need to run:

I run crontab -e :

and I add that line, then I press ctrl-X and press y to save.

If all goes well, the cron job is set up:

Screen-Shot-2020-09-09-at-18.06.19

Once this is done, you can see the list of active cron jobs by running:

Screen-Shot-2020-09-09-at-18.07.00

You can remove a cron job running crontab -e again, removing the line and exiting the editor:

Screen-Shot-2020-09-09-at-18.07.40

Calling uname without any options will return the Operating System codename:

Screen-Shot-2020-09-07-at-07.37.41

The m option shows the hardware name ( x86_64 in this example) and the p option prints the processor architecture name ( i386 in this example):

Screen-Shot-2020-09-07-at-07.37.51

The s option prints the Operating System name. r prints the release, and v prints the version:

Screen-Shot-2020-09-07-at-07.37.56

The n option prints the node network name:

Screen-Shot-2020-09-07-at-07.38.01

The a option prints all the information available:

Screen-Shot-2020-09-07-at-07.38.06

On macOS you can also use the sw_vers command to print more information about the macOS Operating System. Note that this differs from the Darwin (the Kernel) version, which above is 19.6.0 .

Darwin is the name of the kernel of macOS. The kernel is the "core" of the Operating System, while the Operating System as a whole is called macOS. In Linux, Linux is the kernel, and GNU/Linux would be the Operating System name (although we all refer to it as "Linux").

The env command can be used to pass environment variables without setting them on the outer environment (the current shell).

Suppose you want to run a Node.js app and set the USER variable to it.

You can run

and the USER environment variable will be accessible from the Node.js app via the Node process.env interface.

You can also run the command clearing all the environment variables already set, using the -i option:

In this case you will get an error saying env: node: No such file or directory because the node command is not reachable, as the PATH variable used by the shell to look up commands in the common paths is unset.

So you need to pass the full path to the node program:

Try with a simple app.js file with this content:

You will see the output as

You can pass an env variable:

and the output will be

Removing the -i option will make PATH available again inside the program:

Screen-Shot-2020-09-10-at-16.55.17

The env command can also be used to print out all the environment variables. If run with no options:

it will return a list of the environment variables set, for example:

You can also make a variable inaccessible inside the program you run, using the -u option. For example this code removes the HOME variable from the command environment:

Here's a quick guide to the printenv command, used to print the values of environment variables

In any shell there are a good number of environment variables, set either by the system, or by your own shell scripts and configuration.

You can print them all to the terminal using the printenv command. The output will be something like this:

with a few more lines, usually.

You can append a variable name as a parameter, to only show that variable value:

Screen-Shot-2020-09-10-at-16.31.20

Thanks a lot for reading this handbook.

I hope it will inspire you to learn more about Linux and its capabilities. It's evergreen knowledge that will not be out of date any time soon.

Remember that you can download this handbook in PDF / ePUB / Mobi format if you want!

I publish programming tutorials every day on my website flaviocopes.com if you want to check out more great content like this.

You can reach me on Twitter @flaviocopes .

Read more posts .

If this article was helpful, share it .

Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started

Check a Website Availability from the Linux Command Line

You can easily test a a website availability from the Linux command line and get the status codes from the web-server using commands like TELNET or CURL.

Check a website availability with CURL

Execute the following command to check whether a web site is up, and what status message the web server is showing:

Status code ‘200 OK’ means that the request has succeeded and a website is reachable.

Here is an another example that shows you how curl displays different status codes.

You’ll notice that if you visit: http://shellhacks.com you are redirected to http://www.shellhacks.com , because I prefer to have www in my site’s URL. I do this by implementing a 301 Redirect (Permanently moved) for any visitor who goes to http://shellhacks.com .

You can also check the availability of a particular page on the site:

Read more: Status Code Definitions

Check a website availability with TELNET

You can also test website availability and get the response code using telnet command:

You will get the output as follows:

That also means that the website is OK.

Leave a Reply Cancel reply

The 3 Best Terminal-Based Web Browsers for Linux

Avoid distractions on the web and regain control of your privacy by browsing the web using a terminal-based web browser on Linux.

Terminal-based browsers are something of a niche interest—even among seasoned Linux users, and most mainstream distros will come with either Firefox or Falkon pre-installed. But there are good reasons why you might want to experience the internet via a browser in your terminal.

Here are some of the best terminal-based web browsers out there.

Why Use a Terminal-Based Web Browser?

The idea of a web browser for your Linux terminal seems like nonsense. After all, the first web browsers were GUI based, and the modern internet is designed around graphics and JavaScript—elements that terminal-based browsers find difficult or even impossible to deal with. But it's this very incompatibility with the modern web which makes them so attractive to some users.

For instance, at the time of writing, The New York Times homepage weighs in at a staggering 24.8MB. That's a lot: it would take 35 old skool floppy discs to store a single copy of the NYT homepage. You can fit fewer than a single month's worth of the NYT homepage on a CD.

If you like reading the news every day, and visit using a regular browser, this can quickly add up, and bandwidth isn't cheap. If you use a terminal-based browser, you load the HTML, but not the images, the videos, or the adverts, saving hundreds of MB over the course of a day.

JavaScript doesn't execute in a terminal browser either, meaning that soft paywalls, such as the one on NYT, don't trigger. You can read as many articles as you want without interruptions.

Images, autoplaying videos, and sound effects are also distracting. By using a text-based browser in your terminal, you can just read.

As the graphical browser world has multiple alternatives such as Firefox, Falkon, Chrome, and surf, so does the universe of terminal browsers. These are some of the best:

Lynx is the oldest web browser that is still maintained, and it was first released for Unix-like systems in 1992—less than a year after the web was made available to the general public.

The package is available in the default repositories of most distros, and there are also versions available for DOS, Windows, macOS, Amiga, and more.

It's easy to use Lynx, just open a terminal and type:

To enter a web address, hit g then input the address, and press Enter .

Alternatively, to launch a web page directly from the command line you can add the name of the site directly to the command before launch.

For instance, if you enter:

...Lynx will open and attempt to connect to bbc, before intelligently trying bbc.com.

Navigation is keyboard driven: Up and Down arrow keys to move to a link. Then Right to follow a link and Left to go back.

Lynx allows the use of cookies , and when a site attempts to use them, Lynx gives you the choice of yes, no, always, and never. It will also specify if the cookies are direct or third-party. Because of the privacy implications of cookies, Lynx supports cookie cache purging, as well as whitelisting and blacklisting.

Although Lynx is simple to install and use, it has hundreds of configuration options, relating to everything from the way it handles cookies, to specifying a text file from which to run commands in sequence. You can get command-line help for Lynx with:

w3m (pronounced W-three-M) is a text-based browser, similar to Lynx but with a few major differences. While some terminal browsers strip back the web to its bare bones, w3m allows a few graphical niceties into your terminal. It can render tables in your terminal, and even frames (by converting them into tables first).

w3m can even display images—although the most common terminals such as the GNOME terminal can't display them. If you want images on the webpage in w3m, you'll need a terminal like xterm.

Like Lynx, w3m is available in most default repositories. To install it on Ubuntu and other Debian-based distributions , enter:

As w3m is technically a pager, it can read documents from standard input, and will also quit if invoked without arguments. Entering:

...will result in the app immediately closing, while:

...will take you to the homepage of this very site! You won't see images, though. w3m doesn't work well with lazy loading.

Navigation is, again, keyboard-driven, and to select a link, hit Enter . The app also boasts a context menu which you can activate by clicking the right mouse button.

ELinks is a well-established, feature-rich text mode web browser, with support for both HTTP and FTP. It's easy to use, straight out of the box, and is, to our eyes, nicer to look at than either w3m or Lynx.

ELinks is available in the standard repositories, and also has binaries available from the project download page , along with instructions for how to compile from the source .

Start up ELinks, and you'll instantly see a prompt to enter the URL you want to visit. And when you get there, you'll be surprised that it makes a good go of rendering CSS and JavaScript. How successful this will be, depends on what site you're trying to view.

Hitting F10 on your keyboard will give you a menu bar where you can toggle images, save URLs, check your history, and more. Each entry in the menu system is accompanied by the appropriate keyboard shortcut, so while you may need to open a menu a few times at first, you'll quickly get the hang of navigating competently using the key bindings.

There's a Terminal-Based Browser for Everyone!

Browsing the web in your terminal is a completely different experience from using a GUI browser, and whichever package you choose will take some getting used to. For a pure, and distraction-free experience which will work in any terminal, Lynx is the one to choose, while if you really think that you need JavaScript and CSS, ELinks is probably what you're looking for.

Remember that to see the full benefits of either ELinks or w3m, your default system terminal won't cut it —use xterm instead.

Exploring the Web Like It's 1993

Terminal-based web browsers let you browse the web on exceptionally low bandwidth and low-spec machines, as well as blocking distractions and giving you greater control over privacy.

Another technology that was around at the time Lynx came onto the scene is the Gopher network, later superseded by the Gemini protocol. This is enjoying a resurgence in popularity among niche tech enthusiasts.

  • Learning the Shell
  • Writing Shell Scripts

You have Linux installed and running. The GUI is working fine, but you are getting tired of changing your desktop themes. You keep seeing this "terminal" thing. Don't worry, we'll show you what to do .

Like the site? You'll love the book! The Linux Command Line by William Shotts

Get LinuxCommand at SourceForge.net. Free Open Source software downloads

© 2000-2024, William E. Shotts, Jr. Verbatim copying and distribution of this entire article is permitted in any medium, provided this copyright notice is preserved.

Linux® is a registered trademark of Linus Torvalds.

  • HTML Cheat Sheet
  • CSS Cheat Sheet
  • JS Cheat Sheet
  • Bootstrap Cheat Sheet
  • jQuery Cheat Sheet
  • Angular Cheat Sheet
  • Facebook SDE Sheet
  • Amazon SDE Sheet
  • Apple SDE Sheet
  • Netflix SDE Sheet
  • Google SDE Sheet
  • Wipro SDE Sheet
  • Infosys SDE Sheet
  • TCS SDE Sheet
  • Cognizant SDE Sheet
  • HCL SDE Sheet
  • Mass Recruiters Sheet
  • Product-Based Coding Sheet
  • Company-Wise Practice Sheet
  • Love Babbar Sheet
  • Geeksforgeeks Cheatsheets - All Coding Cheat Sheets Collections
  • Subnet Mask Cheat Sheet
  • Git Cheat Sheet
  • NumPy Cheat Sheet: Beginner to Advanced (PDF)

Linux Commands Cheat Sheet

  • Pandas Cheat Sheet for Data Science in Python
  • Java Cheat Sheet
  • C++ STL Cheat Sheet
  • Docker Cheat Sheet : Complete Guide (2024)
  • C++ Cheatsheet
  • C Cheat Sheet
  • CCNA Cheatsheet
  • Nmap Cheat Sheet
  • Ethical Hacking Cheatsheet
  • Bootstrap Cheat Sheet - A Basic Guide to Bootstrap
  • Computer Network - Cheat Sheet
  • Angular Cheat Sheet - A Basic Guide to Angular
  • jQuery Cheat Sheet – A Basic Guide to jQuery
  • JavaScript Cheat Sheet - A Basic Guide to JavaScript
  • CSS Cheat Sheet - A Basic Guide to CSS
  • HTML Cheat Sheet - A Basic Guide to HTML
  • Python Cheat sheet (2023)

Linux, often associated with being a complex operating system primarily used by developers, may not necessarily fit that description entirely. While it can initially appear challenging for beginners, once you immerse yourself in the Linux world, you may find it difficult to return to your previous Windows systems. The power of Linux commands in controlling your PC, coupled with their clean user interface, can make it hard to switch back to older operating systems. If you’re a developer, you can likely relate to the advantages and appeal of Linux.

To support developers and beginners alike, we have created a comprehensive Linux/Unix command line cheat sheet . This cheat sheet covers all the basic and advanced commands, including file and directory commands, file permission commands, file compression and archiving, process management, system information, networking, and more with proper examples and descriptions. In addition to that we provide all the most used Linux Shortcut which includes Bash shortcuts, Nano shortcuts, VI & Vim Shortcuts Commands. It provides a solid foundation on Linux OS commands, as well as insights into practical applications.

By the end of this cheat sheet, you will have a basic understanding of Linux/Unix Commands and how it makes development easy for developers.

Linux Commands Cheat Sheet

What is Linux?

Linux is an open-source UNIX-like operating system (OS). An operating system is a software that directly manages a system’s hardware and resources, like CPU, memory, and storage. OS acts as a GUI through which user can communicate with the computer. The OS sits between applications and hardware and makes the connections between all of your software and the physical resources that do the work.

Linux Commands List – Table of Content File and Directory Operations Commands File Permission Commands File Compression and Archiving Commands Process Management Commands System Information Commands Networking Commands IO Redirection Commands Environment Variable Commands User Management Commands Shortcuts Commands List Bash Shortcuts Commands Nano Shortcuts Commands VI Shortcuts Commands Vim Shortcuts Commands FAQs on Linux Commands Cheat Sheet

Basic Linux Commands with Examples

In this Linux cheat sheet, we will cover all the most important Linux commands, from the basics to the advanced. We will also provide some tips on how to practice and learn Linux commands. This cheat sheet is useful for Beginners and Experience professionals.

1. File and Directory Operations Commands

File and directory operations are fundamental in working with the Linux operating system. Here are some commonly used File and Directory Operations commands:

2. File Permission Commands

File permissions on Linux and Unix systems control access to files and directories. There are three basic permissions: read, write, and execute. Each permission can be granted or denied to three different categories of users: the owner of the file, the members of the file’s group, and everyone else.

Here are some file permission commands:

3. File Compression and Archiving Commands

Here are some file compression and archiving commands in Linux:

4. Process Management Commands

In Linux, process management commands allow you to monitor and control running processes on the system. Here are some commonly used process management commands:

5. System Information Commands

In Linux, there are several commands available to gather system information. Here are some commonly used system information commands:

6. Networking Commands

In Linux, there are several networking commands available to manage and troubleshoot network connections. Here are some commonly used networking commands:

7. IO Redirection Commands 

In Linux, IO (Input/Output) redirection commands are used to redirect the standard input, output, and error streams of commands and processes. Here are some commonly used IO redirection commands:

8. Environment Variable Commands

In Linux, environment variables are used to store configuration settings, system information, and other variables that can be accessed by processes and shell scripts. Here are some commonly used environment variable commands:

9. User Management Commands

In Linux, user management commands allow you to create, modify, and manage user accounts on the system. Here are some commonly used user management commands:

10. Shortcuts Commands

There are many shortcuts commands in Linux that can help you be more productive. Here are a few of the most common ones:

10.1: Bash Shortcuts Commands:

10.2: nano shortcuts commands:, 10.3: vi shortcuts commands:, 10.4: vim shortcuts commands:.

In conclusion, Linux is a widely used operating system for development, and as a developer, you should have knowledge of Linux and its basic commands. In this Cheat Sheet, we covered all commands like creating directories, file compression and archiving, process management, system information, networking and more. In addition to that, this Linux Cheat Sheet is organized and categorized, making it easy for developers to quickly find the commands they need for specific use cases. By utilizing this resource, developers can enhance their productivity and efficiency in working with Linux, leading to smoother and more successful development projects.

PS.  Don’t miss our other Python cheat sheet for data science that covers  Scikit-Learn ,  Bokeh ,  Pandas  and Python basics .

FAQs on Linux Commands Cheat Sheet

1. what is linux cheat sheet.

When your memory fails or you prefer not to rely on “linux –help ?” in the Terminal, this linux cheat sheet comes to the rescue. It is hard to memorize all the important linux Commandsby heart, so print this out or save it to your desktop to resort to when you get stuck.

2.What are the basics of Linux?

Kernel . The base component of the OS. Without it, the OS doesn’t work. … System user space . The administrative layer for system-level tasks like configuration and software install. … Applications . A type of software that lets you perform a task.

3. What is 777 in Linux command?

You might have heard of chmod 777. This command will  give read, write and execute permission to the owner, group and public .

4. How do I see what users are doing in Linux?

Using the w Command, w command in Linux shows logged-in users and their activities.

Please Login to comment...

Similar reads.

  • Cheat Sheet
  • linux-command
  • What are Tiktok AI Avatars?
  • Poe Introduces A Price-per-message Revenue Model For AI Bot Creators
  • Truecaller For Web Now Available For Android Users In India
  • Google Introduces New AI-powered Vids App
  • 30 OOPs Interview Questions and Answers (2024)

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

IMAGES

  1. How to use the Whois command on Linux to see domain information on terminal

    linux command visit website

  2. Navigate Linux by the Command Line. These Simple Commands are All you Need

    linux command visit website

  3. 如何直接从Linux终端打开/访问/浏览网站

    linux command visit website

  4. List of basic Linux commands

    linux command visit website

  5. Basic Linux Commands : r/linux

    linux command visit website

  6. 50 Most Useful Linux Commands To Run in the Terminal

    linux command visit website

VIDEO

  1. 60 Second to Linux Command Part-1 #nonightgams #linuxcommands #kalilinux #linuxshorts #linuxmagic

  2. 10 Important Linux Command For DevOps @SenDevOps @linux3111 #devops

  3. Linux Command

  4. Linux Command

  5. Linux Command

  6. Linux Command

COMMENTS

  1. 3 Best Ways to Access a Website in a Linux Terminal

    You can press H at anytime to see the help, and then click on "Key-stroke commands" for a full list of shortcuts. Here are a few useful ones: Left arrow: Go to previous visited URL in the history. + or Space: Scroll down to next page. - or b: Scroll up to previous page. CTRL+A: Go to first page.

  2. 8 Command Line Tools for Browsing Websites and Downloading Files in Linux

    6. Axel. Axel is a command-line-based download accelerator for Linux. Axel makes it possible to download a file at a much faster speed through a single connection request for multiple copies of files in small chunks through multiple http and FTP connections. To install Axel in Linux.

  3. Bash Display Web Page Content In Terminal

    wget command - Free utility for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies. w3m command - A text based Web browser and pager. elinks command - Another text based Web browser and pager for your bash and web page terminal needs.

  4. How to Open/Access/Browse a Website Right from Your Linux ...

    The text-based browsers are widely used by Linux administrator in headless server to browse websites. There are many Linux command-line browsers are available and we will be listing all of them in this article and you can choose the suitable one, which you are preferring. List of text-based web browsers available in Linux are listed below.

  5. linux

    However, if you don't have curl or wget, you can use telnet: telnet x.x.x.x 80. GET /directory/index.php HTTP/1.1. Host: x.x.x.x. Then hit Enter one more time (for the end of headers) and you'll get the raw HTML. You may have to hit Ctrl + D (Unix) or Ctrl + Z (Windows) to exit if the server uses keepalive. Share.

  6. Can I open a certain website with a command line?

    Visit Stack Exchange. ... 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 ... How to open Firefox URL having GET parameter, through Linux Command line. 0.

  7. Browsing the internet from the command line

    Surfraw provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power. It reclaims google, altavista, dejanews, freshmeat, research index, slashdot and many others from the false‐prophet, pox‐infested heathen lands of html‐forms, placing these wonders where they belong, deep in unix ...

  8. How to Browse the Internet Using the Terminal in Linux: 7 Steps

    Download Article. 1. Go to the terminal and type this command sudo apt-get install w3m w3m-img. 2. Type Y when asked to confirm. Now wait; it's just a matter of 3 MBs. 3. Whenever you want to open a web page, go to the terminal and type w3m wikihow.com, with your destination URL in the place of wikihow.com as needed. 4.

  9. Retrieving Webpages Using wget, curl and lynx

    Whether you are an IT professional who needs to download 2000 online bug reports into a flat text file and parse them to see which ones need attention, or a mum who wants to download 20 recipes from an public domain website, you can benefit from knowing the tools which help you download webpages into a text based file.

  10. linux

    There are many ways to get a page from the command line... but it also depends if you want the code source or the page itself: If you need the code source:

  11. Executing Linux / UNIX commands from web page

    For automation purpose, you need to use a web interfaces. Another advantage is you can access your web-based interface from any computer, running any operating system, anytime in the world 😀. In this first part, you will see how to use simple bash (shell) script from web page. In order to execute commands or shell script from a webpage you need:

  12. Use the internet from the command line with curl

    After Firefox is open, you type the website you want to visit into the URL field or a search engine. Then you navigate to the site and click on the page you want to see. More Linux resources. Linux commands cheat sheet; Advanced Linux commands cheat sheet; Free online course: RHEL Technical Overview; Linux networking cheat sheet; SELinux cheat ...

  13. How to enter login information for a website from the linux command

    So When the command is executed: it will copy username in the clipboard. will open the url login to the browser. if cursor already in the login box, press in keyboard Ctrl-v to paste the username. wait for 5 seconds (usually i count 1, 2, 3 .. to 10) tab to the password box and Ctrl-V will input the password.

  14. explainshell.com

    match command-line arguments to their help text. write down a command-line to see the help text that matches each argument

  15. Best Terminal-based Web Browsers for Linux Users

    1. W3M. w3m is a popular open-source text-based web browser for the terminal. Even though the original project is no longer active, an active version of it is being maintained by a different developer Tatsuya Kinoshita. w3m is quite simple, supports SSL connections, colors, and in-line images as well.

  16. The Linux Command Handbook

    This Linux Command Handbook will cover 60 core Bash commands you will need as a developer. Each command includes example code and tips for when to use it. This Linux Command Handbook follows the 80/20 rule: you'll learn 80% of a topic in around 20% of the time you spend studying it. I find that this approach gives you a well-rounded overview.

  17. practicelinux.com

    Finally master Linux, Vim and more through fun interactive exercises. We made this website to help you learn commands and shortcuts and save time. Learn Linux through interactive exercises. Learn hundreds of commands including vim, git, gpg, grep, netstat, tmux and many more. Improve your coding speed with vim. No setup, practice in your browser.

  18. Check a Website Availability from the Linux Command Line

    You can easily test a a website availability from the Linux command line and get the status codes from the web-server using commands like TELNET or CURL. Check a website availability with CURL. Execute the following command to check whether a web site is up, and what status message the web server is showing:

  19. The 3 Best Terminal-Based Web Browsers for Linux

    The app also boasts a context menu which you can activate by clicking the right mouse button. 3. ELinks. ELinks is a well-established, feature-rich text mode web browser, with support for both HTTP and FTP. It's easy to use, straight out of the box, and is, to our eyes, nicer to look at than either w3m or Lynx.

  20. Four Web Browsers for the Linux Command Line

    Remember the days when the web was as simple as searchable text. The terminals and low powered personal computers were enough to access the text-based web over snail-paced internet connections. Of course, people then used the command-line web browsers to visit the web; these included the famous Lynx browser as well.

  21. LinuxCommand.org: Learn The Linux Command Line. Write Shell Scripts

    LinuxCommand.org is a web site that helps users discover the power of the Linux command line.

  22. Linux Commands Cheat Sheet: Beginner to Advanced

    This cheat sheet covers all the basic and advanced commands, including file and directory commands, file permission commands, file compression and archiving, process management, system information, networking, and more with proper examples and descriptions. In addition to that we provide all the most used Linux Shortcut which includes Bash ...

  23. Top 50+ Linux Commands You MUST Know

    Jump back to commands list ↑. The touch command in Linux. The touch command in Linux creates an empty file or updates the timestamp of an existing file.. root@ubuntu:~ # touch <file name> Jump back to commands list ↑. The ln command in Linux. To create a link to another file, we use the ln command. This is one of the most important Linux commands that you should know if you're planning ...

  24. An Easy Way To Monitor A Website From Command Line In Linux

    This brief tutorial explains a simplest method to monitor a website from command line in Unix-like systems. We all know that ping command will quickly tell you whether a host or website is up or down. Usually, most of us check whether a website is up or down like below using command: $ ping ostechnix.com -c 3. Sample output: