7

Is there an equivalent to Microsoft Windows' shortcuts in Ubuntu?

I am already aware of both hardlinks and symlinks but they miss one feature I find really interesting. If the target file is moved the shortcut is updated and knows the new location of the file. Hardlinks I believe have this functionality but only on the same file system while symlinks do not.

Is there a link that automatically updates the target location?

Braiam
  • 69,112

2 Answers2

3

Is there an equivalent to Microsoft Windows' shortcuts in Ubuntu?

Lets remember that shortcuts in Windows (those files with a .lnk extension) are files with metadata which represent a file/directory redirection only recognized by the Windows file manager, explorer.exe.

Linux, ergo Ubuntu, doesn't have the same behavior. Instead of a file that can only be interpreted by only the file manager, it uses the Freedesktop specification of .desktop files. There's a counterpart for directories which uses .directory extension, but the behavior "you open one of these files, and some file/directory gets executed" is the same as explorer shortcuts. These are supported by most (if not all) file managers available in Ubuntu and Linux.

You can read the complete specification in Freedesktop.org

If the target file is moved the shortcut is updated and knows the new location of the file.

Neither, Freedesktop and Windows Explorer, have such functionality. The only thing that is able to realize it are hard links.

Braiam
  • 69,112
0

You can create a .desktop file. It's just like Windows shortcuts. You can add your own icon, change the name, add description and so on. And you can also add the name and description for different languages in the same shortcut.

More... Creating a .desktop file for a new application

kv1dr
  • 1,381