1

I have Ubuntu 14.0.4 LTS. I have the following folder on my system:

/opt/JBoss_4.0.4.GA/server/default/deploy

Also I have this symbolic link to that folder on my Desktop:

JBoss deploy -> /opt/JBoss_4.0.4.GA/server/default/deploy

When I double click on the link, nautilus opens a directory with this path:

/home/sasan/Desktop/JBoss deploy

But this is what I want:

/opt/JBoss_4.0.4.GA/server/default/deploy

Is there anyway to create a link that acts just like a shortcut? Or is there anyway to create actual shortcut in Linux?

3

There is a standard for desktop entry which is specified in These pages. You can specify what action to take when you open (effectively click) that desktop item. The action can be bash commands.

Or in your case:
nautilus /opt/JBoss_4.0.4.GA/server/default/deploy

Just For the sake of completeness, here's an example: Chrome.desktop

[Desktop Entry]
Name=Google Chrome
Exec=google-chrome-stable
Type=Application
StartupNotify=true
Path=/usr/bin/
Icon=/home/bibek/.local/share/icons/hicolor/32x32/Google-Chrome-Google-Chrome.ico
Name[C]=Chrome

This is what the shortcut for chrome looks like in my Mint Desktop. That Exec line is what actually gets executed on click events, assuming the entry right after = is executable (arguments are separated by space).

| improve this answer | |
  • this is command that I use for opening a current directory from command line in GUI. – Raghvendra Jan 6 '16 at 8:29
0

The FreeDesktop standard defines multiple kinds of desktop entries:

This specification defines 3 types of desktop entries: Application (type 1), Link (type 2) and Directory (type 3).

Using a type-1 (Application) desktop file is one option, but Link-type desktop files will also work for your purposes and is not tied to a particular file manager. For the example given, create a file on your desktop called deploy.desktop and insert these contents:

[Desktop Entry]
Name=Link to deploy
Type=Link
URL=file:///opt/JBoss_4.0.4.GA/server/default/deploy/
Icon=folder

It looks like this:

Link to deploy

and opens to this path in the default file manager:

/opt/JBoss_4.0.4.GA/server/default/deploy/

Note that if the path contained spaces or other special characters, it would need to be percent escaped to convert a path into a valid file:// URL. Some file managers can assist you if you encounter difficulty doing this by hand.

Related:

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.