The bookmark name as an argument

hlg takes an optional argument, which is the name of the bookmark to be launched. The assumption is that the bookmark is present in the bookmarks file, otherwise you will get an error if it is not there.

For example, if you have a bookmark called "linux-today", whose location is https://www.linuxtoday.com/, you can simply invoke hlg to launch this bookmark in your browser as follows:

$ hlg linux-today

If there is no bookmark with that name, hlg will complain and exit. So make sure the case you use is the same in the bookmark file and on the terminal.

If, on the other hand, you have that bookmark, and there is no ambiguity, you can simply type the first few characters and press ENTER, like this:

$ hlg lin

If "linux-today" is the only one starting with lin, it will be launched.

Just note that bookmark names are case-sensitive. Hence, Linux is not the same as linux.

The case you type on the terminal is what hlg uses to look up in the bookmarks database, whether qualified or not.

However, if your bookmark has got a dash or an underscore, you can just type the first word, and hlg will launch the bookmark for you. Hence, typing "linux" instead of "linux-today" will still launch your bookmark.

This is of course problematic if a number of bookmarks share a common prefix separated by dashes or underscores. So you can choose to rely on other means to differentiate them. This can be either through:

  • Assignment of shortcut keys, or

  • Just rename bookmarks and make sure that each of them is unique in the database.

You may think that since entering a prefix of a bookmark can launch it, so is simply typing its first character.

Unfortunately, this does not work this way:

  • If you type the first character, hlg will treat this as a shortcut key and try to look for that key;

  • Otherwise, single keystrokes are never used to guess a full name of a bookmark. Instead they have special meanings as shown in the next sections.