-   Linux - Newbie (
-   -   Mounting a directory as a shortcut? (

x837cue 11-03-2008 05:01 AM

Mounting a directory as a shortcut?

I'm trying to make a shortcut to a very long directory path (the scratchbox user home directory). I would like to have a fast access to this folder from the Desktop or user directory. Is there a way to add a reference mount like this?

Thanks in advance!

klearview 11-03-2008 05:16 AM

So are you trying to mount some media or are you trying to make a shortcut?

If it's a shortcut both KDE and Gnome provide such a functionality - right-click on a Desktop choose 'create new link' (I think in Gnome it's 'create new launcher').

From command line it's 'ln -s /path/to/that/directory Desktop'

colucix 11-03-2008 05:21 AM

It depends from which desktop manager you're using. For example in KDE you can right-click on the desktop, chose "Create New" --> "Link to location" and select the proper folder to be browsed when you click on the link icon.

In a terminal, if you want to access a particular directory without writing its path every time, you can create an alias like:

alias cloc='cd /very/long/path/to/scratch/directory/annoyed/to/type/every/time'
If you want to open a directory using the browser from the command line, you can simply issue something in the form

konqueror file:///path/to/some/dir
depending on the browser commonly used by your desktop manager (e.g. konqueror in KDE, nautilus in GNOME, and so on). You can create an alias for this, too.

klearview 11-03-2008 05:25 AM

If it's mounting that you're after - on Linux you can mount any directory in another place by using this command (as root):

mount --bind /path/to/that/directory /path/to/new/directory.

This way data will be accessible in two different places.

For example I can create wwwdevelop folder on my Desktop and do this:

sudo mount --bind /var/www /home/<username>Desktop/wwwdevelop

x837cue 11-03-2008 08:06 AM

Thanks for the help! The symbolic link was the solution :).

All times are GMT -5. The time now is 10:55 AM.