0

I want to change the owner from root to user of a folder named $RECYCLE.BIN. I'm using ubuntu 16.04 LTS. I'm new to ubuntu.

  • 1
    Each user should have their own recycle bin. A root recycle bin should occur only if you (unwisely) used a GUI as root. Try to avoid doing that. If you have files in root's recycle bin, use sudo rm /path/to/recycle/bin/* to permanently delete the contents. Obviously, you must fill in the proper path yourself. – user535733 Jun 18 '20 at 22:59
  • @user535733 I was also curious as to why OP had a recycling bin owned by root, but while your method would delete the contents of the folder, it would likely be better to delete the folder entirely. The proper command to remove the folder itself would be sudo rm -R /path/to/directory/'$RECYCLE.BIN', though that's not the advice that OP was asking for. –  Jun 18 '20 at 23:12

2 Answers2

0

This command will make the current user own the folder and all it's contents:

sudo chown -R $USER <your-folder-name>

Hope it helps!

Ollie
  • 2,932
0

I'm quite curious why your recycle bin is owned by root, but I'll go ahead and give you the answer. Open a terminal with Ctl+Alt+T or by searching for it in your application screen. First navigate to the directory that the folder is located in (if it isn't just in the home folder, that is):

cd /path/to/directory

Next, all you should have to do is a simple chown command. The -R makes the command recurse into the folder so you transfer ownership of everything inside the folder instead of just the folder itself. If there is some reason not to do this, then simply exclude the -R modifier.

sudo chown -R $USER '$RECYCLE.BIN'

And that should really be it; the folder should now be owned by you.

  • @WinEunuuchs2Unix If $REYCLE.BIN is from Windows 10, then it could very well be that it is a Windows file, but OP asked how to transfer ownership in Ubuntu, so I gave Ubuntu commands. I'm guessing that if it's a Windows file, then it was likely just transferred over. Given that it's a recycling bin, I should have also showed OP how to use sudo rm -r, but I commented that earlier, so I feel it would be redundant to add it, and an rm command doesn't answer OP's question. –  Jun 23 '20 at 01:29
  • @WinEunuuchs2Unix I have not indexed any Windows files, but if I run locate RECYCLE, it returns /home/$USER/$RECYCLE.BIN. It's more likely than not that OP is looking at the Ubuntu recycling bin, and they've done something that restricted their recycling bin to root. In the slim chance that it IS from Windows 10, then the same command would work to change permissions, so I don't see what you're really getting at. –  Jun 24 '20 at 03:12