2

So I have a tar.bz2 folder called 'project' that I extracted in the directory /home/eric

I'm asked to make a symbolic link /src/project which points to the directory where I untarred it. The given command for this is "sudo ln -s /YOUR_DIRECTORY /src/project" to create the link.

I tried doing "sudo ln -s /home/eric /src/project" but I get the error "ln: failed to create symbolic link '/src/project': No such file or directory"

I don't quite understand this error, as the path /src/project should not already exist right? The extracted tar file is located in /home/eric but I'm trying to create a link to this directory. Am I supposed to actually create a folder for src in home/eric and move the project folder inside of it so that the new path of project would be home/eric/src? I'm very confused as to why this is not working.

I verified the path link to the project file is correct as 'command pwd' returns '/home/eric'. I also tried replacing the -s in the command with -sf and that didn't work either.

1 Answer 1

2

I'm guessing that your system doesn't already have a /src directory. ln won't create that for you; it will (as you've seen) give an error instead.

I think that if you create that directory first, then your command will work.

1
  • In my case, I had spaces in my destination path, and it didn't like how I put quotes around them: "~/path to/destination folder" gave the OP's error, while ~/"path to"/"destination folder" worked.
    – AaronD
    Oct 8, 2021 at 19:39

Your Answer

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