1

This question must have been asked before, but I faced an error message that I couldn't find much about...

I want to create a link for a directory (its content) ~/abc/def/ghi/ to another directory ~/tuv/wxy. I am currently on the source directory so I do the command below:

$ ln -s ./ ~/tuv/wxy

but when I go to ~/tuv/ I see that wxy is pointing to ./ and obviously the link creation has failed.

So my question is how can I execute the command above without the need to type the full (or generally this can be useful for a lot of cases).

Maybe what I need is to use pipes, something like pwd | ln -s "$RESULT" ~/tuw/wxy but I do not know the current syntax.

1 Answer 1

3

Use the PWD variable, or the pwd command with command substitution:

ln -s "$PWD" ~/tuv/wxy
ln -s "$(pwd)" ~/tuv/wxy

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .