Results 1 to 5 of 5

Thread: Symbolic Link

  1. #1
    Join Date
    May 2008
    Location
    Ontario, Canada
    Beans
    Hidden!
    Distro
    Ubuntu

    Question Symbolic Link

    Hey Everyone,

    I have a neat problem, something I haven't seen before.

    I have made a symbolic link of a folder, and wish to remove this link.
    This is the result.

    [****@BlackFedora Dropbox]$ rm Pictures/
    rm: cannot remove `Pictures/': Is a directory

    [****@BlackFedora Dropbox]$ rmdir Pictures/
    rmdir: failed to remove `Pictures/': Not a directory

    [****@BlackFedora Dropbox]$ rm Pictures/
    rm: cannot remove `Pictures/': Is a directory
    What is going on here?

    Extra hints
    [vandorp@BlackFedora Dropbox]$ ls -l
    total 256
    lrwxrwxrwx 1 home-user home-user 23 Jun 6 17:31 Pictures -> /home/home-user/Pictures/
    Last edited by vandorjw; July 24th, 2012 at 05:46 PM.

  2. #2
    Join Date
    Aug 2010
    Location
    Lancs, United Kingdom
    Beans
    1,588
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Symbolic Link

    Code:
    rm Pictures
    Note, no trailing slash.

  3. #3
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: Symbolic Link

    My default rm doesn't delete directories, you have to use the -r switch.
    Code:
    rm -r Pictures
    It doesn't make a difference whether you type the trailing slash or not.
    Cheesemill

  4. #4
    Join Date
    Aug 2010
    Location
    Lancs, United Kingdom
    Beans
    1,588
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Symbolic Link

    Quote Originally Posted by Cheesemill View Post
    My default rm doesn't delete directories, you have to use the -r switch.
    @Cheesemill Perhaps I'm mistaken, but from the topic and 'ls -l' in the OP, I had understood that the intent was to remove a link to a directory, not to remove a directory. Apologies if I've misunderstood.

  5. #5
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: Symbolic Link

    Quote Originally Posted by spjackson View Post
    @Cheesemill Perhaps I'm mistaken, but from the topic and 'ls -l' in the OP, I had understood that the intent was to remove a link to a directory, not to remove a directory. Apologies if I've misunderstood.
    Yep, you're right. I was getting it mixed up with something else. You just need:
    Code:
    rm Pictures
    Cheesemill

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •