Can you explain this to me #ln -s :"target is not a directory"?

Solution 1:

You probably copied and pasted the ln -s command from another source and the system inserted the wrong type of -. Try deleting the - and typing it again manually.

Solution 2:

The problem is the difference between this...

sudo ln –s path1 path2

and this...

sudo ln -s path1 path2

Don't see the difference? Short dash vs. long dash.

The long dash is not interpreted as an option and so ln sees three paths on the command line and expects the last to be a directory.


Solution 3:

Try: sudo a2ensite LoginProject

You could also do sudo ln –s /etc/apache2/sites-available/LoginProject /etc/apache2/sites-enabled/


Solution 4:

Try ln with single argument like below and see whether it helps,

cd /etc/apache2/sites-enabled/ ; sudo ln -s /etc/apache2/sites-available/LoginProject

Solution 5:

Try quoting the directories and terminating the sudo command arguments like so:

sudo -- \ln –s "/etc/apache2/sites-available/LoginProject" "/etc/apache2/sites-enabled/LoginProject"

Tags:

Linux

Bash