How to create folder shortcut in Ubuntu 14.04?

I have a folder in my Dropbox and I want to add a shortcut of that folder on my Desktop. I guess this should be extremely easy as in Windows OS :) However, I have no idea how to do it in Ubuntu 14.04.

Is there anything I can do to create a simple folder shortcut on my desktop?


Solution 1:

it simple: just press Ctrl + Shift and drag.

Solution 2:

Click on that folder, click on make link, then move the shortcut to Desktop.

Solution 3:

You can read full details here

man ln

ln -s /usr/bin/bar /opt/foo

also see this link Create a soft or symbolic link

Solution 4:

Apparently this is handled correctly from the GUI :-) (14.04 LTS)
(Move to Trash, Empty Trash)

But generally: When you have a link to a directory, be VERY sure to delete ONLY the link should/when you come to that point.

From terminal, the correct thing to do is:

rm LINK-TO-DIR


BUT NOT:

rm -r LINK-TO-DIR

... which will first delete the files/dirs that the link MAKES VISIBLE,
and even more so with the "-f" flag.


If you are a "Terminal" user, have a look on the output of

ln --help

... that ls lover case of LN nothing else ;-)

The syntax for it may seem a tad "backwards" at first as you FIRST specify where it should point, then the name of your LINK.

cd $HOME/Desktop
mkdir -p $HOME/z
ln -s $HOME/z New-Link-To-Home-z

... note that the GUI will not notice the new Desktop content without help; you need to logout+login.

More info on the 'net or slightly terse in either of

man ln
info ln

... where I personally prefer the first because 'info' has a tendency to 'slip out of context'.

Solution 5:

I wasn't able to file a reliable solution from the other provided answers. As such, I'm sharing my preferred approach to creating a desktop shortcut.

Desktop shortcuts can be added by creating a file with the .desktop extension in the ~/Desktop/ folder using any text editor. The .desktop file we create shall launch the folder viewer app xdg-open at the location specified by [folder-path].

Though it's not necessary, it is of course sensible to name the file similarly to the folder name.

The following information should be written to ~/Desktop/[file-name].desktop:

[Desktop Entry]
Name=[folder-name]
Exec=xdg-open [folder-path]
Type=Application
Terminal=false
Icon=[icon-path]

Replacing [folder-name] with the name of the folder and [folder-path] with the location of the folder.

Please Note: If the location or name of the folder changes then the .desktop entry will require to be edited.

Once the file has been created it shall appear on the desktop. Right click it and click Allow Launching to activate the .desktop file as an application.

You can replace [icon-path] with an image of your choice; Default Ubuntu icons are located at: /usr/share/icons/.

Examples of default Ubuntu folder icons include (but are not limited to):

  • /usr/share/icons/Yaru/48x48/places/folder.png
  • /usr/share/icons/Humanity/places/48/folder.svg
  • /usr/share/icons/HighContrast/48x48/folder.png

For more information on the Desktop Entry Specification please see: https://developer.gnome.org/desktop-entry-spec/

Note that as our file is launching xdg-open it is proper to use the .desktop extension, rather than the .directory extension.