Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Feb 2002 11:25:30 -0600
From:      jacks@sage-american.com
To:        "Malan Joubert" <malan_joubert@hotmail.com>, freebsd-questions@FreeBSD.ORG
Subject:   Re: symbolic links on ftp
Message-ID:  <3.0.5.32.20020213112530.0196bec8@mail.sage-american.com>
In-Reply-To: <F349lVBqR9VN0sF8GL100018479@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Ouch! Don't go experimenting with 'root'...!! Always use a test file or
directory. Her's a brief on sym links:
****************
Understanding the location of linked directories
There is a subtle difference between a "normal" directory and a directory
created with a symbolic link to another directory.

What happens if you do a cd (change directory) to this type of directory?
You are placed in the directory that the symbolic link points to.

This can be confusing, especially if you have changed your shell prompt so
that it displays the current working directory.

Look at this example:

   pwd
       (print the user's working directory)
   /usr/home/john/tmp
   ln -s $HOME/accounts/may fifth
       (use a symbolic link named fifth that points to
        the directory $HOME/accounts/may)
   ls
   fifth
   cd fifth
       (change directory to the new directory)
   pwd
       (print the working directory)
   /usr/home/john/accounts/may
       (the user is actually in the the directory that the
        linked directory points to)

When the user does a cd (change directory) to the symbolically linked
directory may in their current working directory, they change to the
directory that this link points to, the directory /usr/home/john/accounts/may.

Examples of using the ln -s command
To make a symbolic link from a file in one subdirectory to a file in
another subdirectory:

   ln -s reports/reportA publications/my_report

This makes a symbolic link between the file reportA in the subdirectory
reports and the filename my_report in the publications subdirectory.


----------------------------------------------------------------------------
----

To make a symbolic link to a file in a subdirectory to your current working
directory:

   ln -s docs/editors/vi.ref .

This makes a symbolic link between the file vi.ref in the subdirectory
docs/editors/ to the filename vi.ref in the current working directory.



At 07:11 PM 2.13.2002 +0200, Malan Joubert wrote:
>Hi
>I am trying to set up an FreeBSD ftp.
>It's totally unsecure (read + write on incoming) as it's only going to be 
>used on my LAN but I can't get all of it going:
>How do symbolic links work? I want to link the /cdrom directory to be shared 
>via ftp is this possible?
>I did a ls -s  and managed to link my / to the ftp directory something which 
>I immediately tried to undo:( I did the following:
>cd /var/ftp
>rm -R /
>Noooooooooo!!!!!!!!!! It killed my root so at the moment my box is busy 
>reinstalling!!!!!!!!!
>Anyone care to explain links to me, I tried the manual but it doesn't really 
>say anything...
>
>Bye + Thanx
>Malan Joubert
>
>
>_________________________________________________________________
>Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>
>To Unsubscribe: send mail to majordomo@FreeBSD.org
>with "unsubscribe freebsd-questions" in the body of the message
>
>

Best regards,
Jack L. Stone,
Server Admin

===================================================
Sage-American 
http://www.sage-american.com
jacks@sage-american.com

"My center is giving way, my right is in retreat;
....situation excellent! ....I shall attack!"
===================================================

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.5.32.20020213112530.0196bec8>