Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Cannot delete trash.

  1. #1
    Join Date
    Jan 2009
    Location
    Edmond, OK
    Posts
    63

    Default Cannot delete trash.

    I have a folder with other folders & files in it. I want it deleted. When I empty trash it says permission denied.

    11.1, Gnome.

  2. #2
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,379
    Blog Entries
    1

    Default Re: Cannot delete trash.

    Open a terminal window (console), and become root with su command. Then navigate to Trash directory, located in user's home directory. Something like:

    cd /home/name_of_user/.local/share/Trash/

    There are 2 directories contained here: 'files' and 'info'. You can either delete the directories and files with

    rm -r * (take care to make sure you're in right directory first)

    or navigate to 'files' directory and remove the offending files with

    rm -f ....

    (The directories get regenerated the next time files are moved to trash anyway).

  3. #3
    Join Date
    Jan 2009
    Location
    Edmond, OK
    Posts
    63

    Default Re: Cannot delete trash.

    the name of the folder is 1


    william@linux-rb3c:~> su
    Password:
    linux-rb3c:/home/william # cd/home/william/share/trash
    bash: cd/home/william/share/trash: No such file or directory
    linux-rb3c:/home/william # cd/home/william/.local/share/trash
    bash: cd/home/william/.local/share/trash: No such file or directory
    linux-rb3c:/home/william # cd /home/william/.local/share/Trash/
    linux-rb3c:/home/william/.local/share/Trash # rm -1
    rm: invalid option -- '1'
    Try `rm --help' for more information.
    linux-rb3c:/home/william/.local/share/Trash #

  4. #4
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,379
    Blog Entries
    1

    Default Re: Cannot delete trash.

    You need to make sure you are in the correct directory first (and take care with syntax). The ls -a
    command will show whats contained within a directory. If you see 'files' directory, then do

    cd files

    ls -a

    Delete required directory with recursive flag

    rm -r 1

    (Similarly rm -f ... for files).

  5. #5
    Join Date
    Jun 2008
    Location
    relative
    Posts
    1,172

    Default Re: Cannot delete trash.

    No, no it's so confusing. Recursion, omg.

    @william, what you did here:
    william@linux-rb3c:~> su
    Password:
    ...
    linux-rb3c:/home/william # cd /home/william/.local/share/Trash/
    linux-rb3c:/home/william/.local/share/Trash # rm -1
    rm: invalid option -- '1'
    Try `rm --help' for more information.
    linux-rb3c:/home/william/.local/share/Trash #
    was absolutely right, so repeat it - some lines being removed they have NO sense, so you don't need to type them again.
    Now make sure that you are in the right directory by typing:
    Code:
    ls
    The output should be
    Code:
    1
    if you can't see this file, make sure that you have typed exactly the same commands as before!
    No remove the file with:
    Code:
    rm 1
    this is a number - one - not a letter!
    http://mydailyhash.wordpress.com/
    http://yami.googlecode.com/

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,142

    Default Re: Cannot delete trash.

    Quote Originally Posted by wgcrowder View Post
    the name of the folder is 1


    william@linux-rb3c:~> su
    Password:
    linux-rb3c:/home/william # cd/home/william/share/trash
    bash: cd/home/william/share/trash: No such file or directory
    linux-rb3c:/home/william # cd/home/william/.local/share/trash
    bash: cd/home/william/.local/share/trash: No such file or directory
    linux-rb3c:/home/william # cd /home/william/.local/share/Trash/
    linux-rb3c:/home/william/.local/share/Trash # rm -1
    rm: invalid option -- '1'
    Try `rm --help' for more information.
    linux-rb3c:/home/william/.local/share/Trash #
    There are a lot of spaces missing in what you type!!!!!
    Take care. When you would have copied/pasted the commands this would not have been possible.

    Also I would recommend all involved very strongly to use the CODE tags around this sort of coding (like ram88 does) to make evry character readable.
    Henk van Velden

  7. #7
    Join Date
    Oct 2008
    Location
    mexico cityx
    Posts
    81

    Default Re: Cannot delete trash.

    I just had this problem. All the explanations above are correct, but I thought someone might find this useful. I solved it like this:

    1.- Open a terminal and become root.

    Code:
    su
    2.- Go to /home/user/.local/share/Trash, where user is your username.

    Code:
    cd /home/user/.local/share/Trash
    3.- See which files there are in the folder you're in

    Code:
    l
    Typing l instead of ls allows you to see all files, even the hidden files. There should be the two folders mentioned by deano above: 'files' and 'info'. Go to 'files' using the cd command.

    Code:
    cd files
    3.- You should be able to see the files you want to delete. If it is a file, type

    Code:
    rm filename
    If it's a directory, go to step 4. Directories are displayed in blue.

    4.- If it's a directory, enter the directory, again with the cd command, and check out if there are any files, and repeat what you did in 3. If it's a directory, enter it and do the same. The idea is to go all the way down and delete one by one the files and the directories, then go one step up, do the same and so on, until you are again in the 'files' directory, empty. Note: To go up one level, type

    Code:
    cd ..
    Hope this helps.
    why do people open source?

  8. #8
    Join Date
    Jan 2009
    Location
    PARADISE
    Posts
    929

    Default Re: Cannot delete trash.

    Ive had this issue a long time ago too. How did I solve it?
    Well, easy: Log in as root once, navigate to the trash in /home/<username>/Desktop (or whereever your bin is located), right-click and empty.

    Then log out, enter your normal-user session adn you should be good to go.

    TheMask.
    CHECK OUT THESE GitHub PROJECTS!

    https://secupwn.github.io/Android-IMSI-Catcher-Detector/
    https://github.com/SecUpwN/Spotify-AdKiller

  9. #9
    Join Date
    Jun 2008
    Location
    relative
    Posts
    1,172

    Default Re: Cannot delete trash.

    Quote Originally Posted by TheMask View Post
    Ive had this issue a long time ago too. How did I solve it?
    Well, easy: Log in as root once, navigate to the trash in /home/<username>/Desktop (or whereever your bin is located), right-click and empty.

    Then log out, enter your normal-user session adn you should be good to go.

    TheMask.
    Okay, but logging in as root isn't the best idea if you want to do anything. I don't recommend this. You can cause even more (serious)problems then your trash-corruption.
    http://mydailyhash.wordpress.com/
    http://yami.googlecode.com/

  10. #10
    Join Date
    Jan 2009
    Location
    PARADISE
    Posts
    929

    Default Re: Cannot delete trash.

    Quote Originally Posted by ram88
    Okay, but logging in as root isn't the best idea if you want to do anything. I don't recommend this. You can cause even more (serious)problems then your trash-corruption.
    Fully agreed. If the issue is really bothering and unless you know what you are doing in root, it should not be a problem though...
    Yeah, and I almost forgot to add the golden rule: Think, BEFORE you act.

    TheMask.
    CHECK OUT THESE GitHub PROJECTS!

    https://secupwn.github.io/Android-IMSI-Catcher-Detector/
    https://github.com/SecUpwN/Spotify-AdKiller

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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