---
slug: "open-link-like-html-a-tag-in-terminal"
title: "Create URL Links in the Terminal"
description: "With applications like iTerm2, you can make a link text open a different URL by Command + clicking, similar to how the a tag works in HTML."
url: "https://www.ytyng.com/en/blog/open-link-like-html-a-tag-in-terminal"
publish_date: "2022-12-27T12:16:32Z"
created: "2022-12-27T12:16:32Z"
updated: "2026-02-27T09:46:15.187Z"
categories: ["Shellscript(Bash/Zsh)"]
keywords: ""
featured_image_url: "https://media.ytyng.com/resize/20250711/64eedeee07c34c5eb6d91843a3093bef.png.webp?width=768"
has_video: false
has_music: false
video_urls: []
music_urls: []
lang: "en"
---

# Create URL Links in the Terminal

You can make applications like iTerm2 open a URL different from the link text by Command + clicking, similar to the HTML `<a>` tag.

[Hyperlinks in Terminal Emulators](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda)

```bash
printf '\e]8;;http://example.com\e\\This is a link\e]8;;\e\\\n'
```

![Image](https://media.ytyng.com/20221227/5424e5f02ffe4cf6825d3530e0c5ce0b.png)
