Bilbo Dave
Posts: 5
Joined: Sun Dec 02, 2012 10:47 pm

Creating Shortcuts to folders

Sun Dec 02, 2012 10:54 pm

Hi

Dose anyone know how can i make a desktop shortcut to a folder on a USB pen drive?

I know it sounds simple but i have been wracking my brains for ages and can not come up with the
answer. All i want to do is put a shortcut on my desktop so i do not have to continually navigate my way to the folders sorted on the "hard drive" (USB PEN).


Thanks

User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
Contact: Website

Re: Creating Shortcuts to folders

Sun Dec 02, 2012 11:14 pm

use the "ln -s" command from the command line

Shortcuts are known as 'symbolic links' in the unix world
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

Bilbo Dave
Posts: 5
Joined: Sun Dec 02, 2012 10:47 pm

Re: Creating Shortcuts to folders

Sun Dec 02, 2012 11:22 pm

SN wrote:use the "ln -s" command from the command line

Shortcuts are known as 'symbolic links' in the unix world
Ok im still a bit new to this so am guessing that I would put the folder path in after "In -s"

is that right?

if so how do I then create the link on the desktop?

thanks

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Creating Shortcuts to folders

Mon Dec 03, 2012 2:12 pm

As I see it, your question is really less a question about shortcuts than a question about how to put an icon on your desktop, to a folder that has been symlinked.

How about specifying what distribution and what windows manager/desktop you are using? That could be helpful in googling for an answer.

The idea of a symlink is you can type the name of the symlink on the commandline, and it will act the same as if you had typed the full path to the file that the symlink points to. It is a cool feature of Linux.

The full syntax will be:

ln -s ABSOLUTE-PATH-TO-FOLDER NEWNAME-IN-CURRENT-DIRECTORY

But you have to add a desktop entry to NEWNAME-IN-CURRENT-DIRECTORY. Knowing your distribution and window manager/desktop software will help to get an answer.

The question in my mind is if you have to place the new symlink name in a specific folder that your distribution will recognize as requiring a desktop icon, instead of in your current directory. My hunch is you will need to do that.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

Bilbo Dave
Posts: 5
Joined: Sun Dec 02, 2012 10:47 pm

Re: Creating Shortcuts to folders

Tue Dec 04, 2012 8:46 pm

Right

i am running Raspbian “wheezy” with LXDE.

When i type:

ln -s media/ADATA UFD/bilbos_tunes /home/pi/Desktop

i get a leaf pad file called bilbos_tunes and thats it. why can't i get the link to the folder to work?

Please help

User avatar
terrycarlin
Posts: 70
Joined: Thu Jun 14, 2012 10:42 pm

Re: Creating Shortcuts to folders

Tue Dec 04, 2012 9:05 pm

you have a couple of problems with your command line "ln -s media/ADATA UFD/bilbos_tunes /home/pi/Desktop".

#1 is the media directory (folder) is located in the root directory "/". Therefore you need to include a leading "/". ie: /media

#2 is the space between ADATA and UFD. The space is a delimiter for the command line. It needs to be "escaped" by a backslash.

So your command should be "ln -s /media/ADATA\ UFD/bilbos_tunes /home/pi/Desktop".
If it ain't broke, take it apart and see how it works.

Bilbo Dave
Posts: 5
Joined: Sun Dec 02, 2012 10:47 pm

Re: Creating Shortcuts to folders

Tue Dec 04, 2012 9:18 pm

Thank you

it works now !!

thought it would have to be some thing simple as missing slashes.

Any know of a good syntax guide for the command line?

Bilbo Dave
Posts: 5
Joined: Sun Dec 02, 2012 10:47 pm

Re: Creating Shortcuts to folders

Tue Dec 04, 2012 9:33 pm

Umm change that....

the link works as long as the device remains powered, when I turn off or reboot the pi I seem to lose the link (it just reverts back to a blank leaf pad file)

why is this? and what can i do about it?

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Creating Shortcuts to folders

Wed Dec 05, 2012 4:14 am

Bilbo Dave wrote: Any know of a good syntax guide for the command line?
There is no such thing as one syntax for all commands, they are each unique. You can see the syntax by looking at a command's man page by typing "man COMMAND" but the output is often far from helpful unless you are already very familiar with the command.

I do have a few webpages where I try to give down to earth information about using the command line, the one that links to a variety of introductory guides that I think are good for newcomers is the following:

http://sdjf.esmartdesign.com/new.html

And my favorite one page simple introductory summary is the following page:

http://freeengineer.org/learnUNIXin10minutes.html

The rule that is different in Linux than Windows that you need to understand is that the space is NOT considered a character in Linux, although Windows does consider it a character. So spaces should not be included in the names of files or directories as they are hard to deal with. You can get around this issue by what someone else mentioned, by "escaping", which means you do something to tell the system that the next space is not a separation between entries (i.e., a delimitor), but rather, is to be considered a character.
You can do this several ways - one is to precede the space with a backslash \ character, another is to surround it with single or double quote marks, another is to surround the whole path that includes a space in it with either single or double quote marks.
Hope that helps....
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

Return to “Beginners”