Skip to content

links Linux command

The links command in Linux is used to create, view, and manipulate symbolic links. Symbolic links are special files that act as pointers to another file or directory on the system. With the links command, you can easily create symbolic links, view the target of an existing link, or remove links when they are no longer needed. This command is particularly useful for managing files and directories in a more efficient and organized way on a Linux system. By using symbolic links, you can access files and directories from different locations without duplicating the actual data, saving storage space and streamlining your file management process.

Terminal window
links [options] [URL]

Options:

OptionDescription
-downloadDownload the file instead of
viewing it in the browser
-gStart the program in graphics
mode (if available)
-textStart the program in text mode
-restrictDisallow JavaScript
-versionDisplay version information
-helpDisplay help information
-nofingerDisable search for .finger file
-noimageDisable displaying images
-sourceView page source
-widthSpecify display width
-dumpDump output to standard output
-useragentSpecify the User-Agent string
-userheaderSpecify user header string

Parameters:

ParameterDescription
URLThe URL of the webpage to open

Open a specific website

Terminal window
links www.example.com

Opens the website “www.example.com” using the links command.

Terminal window
links www.example.com

After opening a website with links, use the arrow keys to navigate through links and interact with the webpage.

Open a website in a new tab

Terminal window
links -g www.example.com

Opens the website “www.example.com” in a new tab using the links command.

Download a file from a website

Terminal window
links -download www.example.com/file.txt

Downloads the file “file.txt” from “www.example.com” using the links command.

View page source code

Terminal window
links -source www.example.com

Displays the source code of the webpage “www.example.com” using the links command.

Submit a form on a website

Terminal window
links -submit www.example.com -post-data "username=myname&password=mypassword"

Submits a form with username and password on the website “www.example.com” using the links command.

To use the links command in Linux, execute the following command:

Terminal window
links www.example.com

To open a specific URL with links in Linux, use the following command:

Terminal window
links https://www.example.com

To navigate back to the previous page in links, press the left arrow key or the ‘b’ key on your keyboard.

To open links in graphical mode in Linux, use the following command:

Terminal window
links -g www.example.com

To follow a link in the links command, position the cursor over the link and press Enter.

To save a webpage with links in Linux, you can use the save feature within the links program. Simply navigate to the desired page and press the ‘d’ key to save it.

Yes, it is possible to view images using the links command by enabling graphics mode. You can toggle graphics mode by using the key combination ‘g’ followed by ‘Shift+G’.

To exit or quit the links program, simply press the ‘q’ key on your keyboard.

  • Creating symbolic links
  • Managing file shortcuts
  • Referencing files in different directories
  • Resolving file paths for easier access