0

I've created this link:

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf

I've tried to remove it in these ways:

sudo unlink /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf
sudo rm ln /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf
sudo rm ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf

These three ways didn't work for me. What have I missed?

kos
  • 35,891

1 Answers1

1

Just do sudo rm /your/link/here. It will remove the link.

kos
  • 35,891
Marton
  • 403
  • 1
    @benos I pasted in the wrong path, I meant that both /etc/apache2/conf-enabled and /etc/apache2/conf-enabled/phpmyadmin.conf are owned by root, so sudo rm /etc/apache2/conf-enabled/phpmyadmin.conf. – kos Jan 03 '16 at 14:29
  • Just want question for clarification please - The phpmyadmin in this path is just a symlink right? Deleting it will not make any problems? If it is only a symlink, why is there many information inside it? –  Jan 03 '16 at 14:37
  • 2
    @benos When you run sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf you're creating a symbolic link in /etc/apache2/conf-enabled/phpmyadmin.conf that points to /etc/phpmyadmin/apache.conf. By running sudo rm /etc/apache2/conf-enabled/phpmyadmin.conf you just delete the symbolic link you just created. – kos Jan 03 '16 at 14:40
  • WOW @kos you clarified much to me thank you! I was confused! I didn't fully understood that in symlinks we "Begin from the end" I.E intuitively it seems that it's apache.conf>>phpmyadmin.conf but it's actually being done from phpmyadmin.conf>>apache.conf (in this particular case). –  Jan 03 '16 at 14:56
  • @benos Yes, exactly. When in doubt check the man page: in this case man ln reports: ln [OPTION]... [-T] TARGET LINK_NAME, i.e. first you mention the path to the target, then the path to the link. Most commands will follow this convention, unless you override it using specific options (for example both in mv and in cp you first specify one or more "target" folders / files, and then where to copy / move them, and as in ln you can change the order of the two with the -t option). – kos Jan 03 '16 at 15:09