How to Use Lynx to Download Files From the Web to a FreeBSD System Using the CLI

Lynx is a text-based web browser capable of accessing Internet resources or content on local file systems. Lynx is distributed as open source software under the GNU General Public License. Lynx supports connections via http, gopher, ftp, wais, nntp, finger, and telnet protocols. Secure HTTP with SSL supported.

Lou Montulli, Charles Rezac, and Michael Grobe were the original designers of the Lynx at the University of Kansas. Lynx started as a project of the University of Kansas in 1989. The university wanted to create a campus-wide information system. Lynx was developed as an interface for information sharing projects between students. Connections to the campus network were made using a Unix-based console that did not support a graphical interface. Early versions of Lynx supported proprietary hypertext formats; this feature was later discontinued after support for HTML was added.

For those who are new to Lynx, it will definitely feel awkward to use it, because we are used to downloading files with a graphic display. Lynx works with a keyboard without a mouse, to download files you need a keyboard to highlight or mark the files to be downloaded. Once the hyperlink is highlighted, press the "enter" key and the download process begins.


1. Lynx Installation Process

This article will guide you to install, configure and use Lynx for the file download process. In this article we use FreeBSD 13.2 Stable OS. Installing Lynx on FreeBSD is very easy, the installation process can use FreeBSD Ports or Package pkg which is a characteristic of FreeBSD, on Linux pkg is the same as apt. OK, let's just start the Lynx installation process on FreeBSD.

root@router2:~ # cd /usr/ports/www/lynx
root@router2:/usr/ports/www/lynx # make install clean
root@router2:/usr/ports/www/lynx # rehash

You can see the Lynx configuration file at /usr/local/etc/lynx.cfg. The file can be configured according to needs, but in practice, if it is only for downloading files, the file does not have to be configured. To run Lynx on FreeBSD, you can run Lynx directly, by typing.

root@router2:~ # lynx



You can exit the menu by pressing the letter "q" followed by pressing the "y" key on the keyboard.


2. Practice Downloading With Lynx

To download files from the web using Lynx, from a Unix command line prompt, type the following lines.
root@router2:~ # lynx http://opengate.osdn.jp/download

The above command line will download the "opengate" file. The image below is a display of the script above.



You can move the cursor to select the version of the Opengate file to download. After the opengate file you want to download has been highlighted or marked, continue by pressing the "enter" button. The download results from this opengate file will be saved in the /root folder. If you want to place the downloaded file in another location, for example the /usr/local/etc folder, then the script above will change as follows.

root@router2:/usr/local/etc # lynx http://opengate.osdn.jp/download

Below we give other examples of how to download files with Lynx
root@router2:~ # lynx https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.5.tar.xz
root@router2:~ # lynx https://updates.cdn-apple.com/2023/windows/032-90920-20230606-31F68023-4408-4152-9644-537F0911A409/WindowsMigrationAssistantSetup.exe
root@router2:~ # lynx https://phpldapadmin.sourceforge.net/wiki/images/d/d4/Logo.jpg
root@router2:~ # lynx https://ubiq.co/tech-blog/wp-content/uploads/2020/12/configure-log-rotation-in-nginx.png
root@router2:~ # lynx https://www.tecmint.com/wp-content/uploads/2015/03/Set-IP-Address-in-FreeBSD.png

Apart from downloading, Lynx can also be used to open a web browser. Below is the Lynx command line to open websites from google.com and ftp.freebsd.org.

root@router2:~ # lynx http://www.google.com
root@router2:~ # lynx ftp://ftp.freebsd.org

Lynx is a text-based Web browser for FreeBSD and other versions of UNIX. Of course, text-based browsers come with the limitation of not being able to display inline graphics, and so on. Still, Lynx can be a fast way to browse the Web, especially on slow connections because it doesn't load any graphics.
Iwan Setiawan

I Like Adventure: Mahameru Mount, Rinjani Mount I Like Writer FreeBSD

Post a Comment

Previous Post Next Post