Mailinglist Archive: opensuse (818 mails)

< Previous Next >
Re: [opensuse] How to delete a symlink and the folder to which it points
On 05/07/12 13:29, Bernhard Voelker wrote:
On 07/05/2012 01:11 PM, lynn wrote:

I wondered if there was a one liner to do that.
L x

readlink is your friend:

$ ln -s ../other-dir link-to-other-dir

$ ls -l
total 0
lrwxrwxrwx 1 berny users 12 Jul 5 13:24 link-to-other-dir -> ../other-dir

$ readlink link-to-other-dir

$ rm -rv link-to-other-dir $(readlink link-to-other-dir)
removed `link-to-other-dir'
removed directory: `../other-dir'

Thanks Berny
Exactly what I wanted.
L x
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
This Thread