Symlink

I know how to create a symlink but I am getting an error message that the file already exists. Also, my symlink doesn't point from target directory to the path correctly,

Here is an example of the path to my folder structure

path: cd /wkspce/wff/DEV/jobs/DEL

the folder structure is:

   DEL \(TOP directory\)
     |
  archive \(subdirectory directory\)
      |
   DEL   \(subdirectory under archive\)

The symlink target directory is the archive directory and path /wkspc/wff/Dev/data/ess/archive/DEL

My symlink needs to point from the archive directory to /wkspc/wff/Dev/data/ess/archive/DEL

DEL (DEL is the TOP directory and archive is a subdirectory and DEL is another subdirectory under archive.

The symlink results need to look like the following:

archive ->   wkspc/wff/Dev/data/ess/archive/DEL

Hi,

Can you provide the full command and syntax you are using to try to create your symlink, as well as a directory listing for the directory you are trying to create it in ? Also, what is the full text of the error that you get ?

In terms of creating the desired link, the least complicated method would be something like this:

cd <full path to directory in which your link needs to exist>
ln -s /wkspc/wff/Dev/data/ess/archive/DEL archive

That would have the effect of creating a symbolic link called archive that points to /wkspc/wff/Dev/data/ess/archive/DEL in whatever directory you cd 'd into in the first step.

In addition to what drysdalk has already said, please consider the following...

At one point you show the path: /wkspce/wff/DEV/jobs/DEL
But you say the symlink should contain: wkspc/wff/Dev/data/ess/archive/DEL

There is a huge difference between an absolute pathname (starting with / ) and a relative pathname starting with any other character. And, on any filesystem that conforms to standards requirements, the directories:

/wkspc/wff/Dev

and:

/wkspce/wff/DEV

are two different directories. Case distinctions are important!

Please verify the actual names of the directories involved and show us the command or function calls you're using to create your symlinks. Without this basic information, there is no way we can help you. It also helps (with any requests posted in this forum) to know what operating system and shell you're using.

Please cd to the root of your directory structure and run

find . -type d -print

Also list the existing symlinks

find . -type l -exec ls -l {} \;

So we get a clear picture.
Then please say at which directory should the symlink be located and where does it point to.

1 Like